Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent launching client thread on exit #2277

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions examples/pxScene2d/src/pxWayland.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,14 @@ pxWayland::~pxWayland()

if ( mWCtx )
{
WstCompositor *ctx = mWCtx;
mWCtx = NULL;
rtLogInfo("removing wayland callbacks before destroying");
WstCompositorSetInvalidateCallback(mWCtx, NULL, NULL);
WstCompositorSetHidePointerCallback(mWCtx, NULL, NULL);
WstCompositorSetClientStatusCallback(mWCtx, NULL, NULL);
WstCompositorSetInvalidateCallback(ctx, NULL, NULL);
WstCompositorSetHidePointerCallback(ctx, NULL, NULL);
WstCompositorSetClientStatusCallback(ctx, NULL, NULL);
terminateClient();
WstCompositorDestroy(mWCtx);
WstCompositorDestroy(ctx);
//Adding mClientTerminated flag check because SIGKILL has to be sent to
//the Process only when it got SIGTERM from terminateClient().
if (mClientTerminated && (mClientPID > 0) && (0 == kill(mClientPID, 0)))
Expand All @@ -143,7 +145,6 @@ pxWayland::~pxWayland()
mClientTerminated = false;
}
mClientPID= -1;
mWCtx = NULL;
}
if (gUIThreadQueue)
{
Expand Down Expand Up @@ -593,7 +594,7 @@ void pxWayland::launchAndMonitorClient()

mClientMonitorStarted= true;

if ( !WstCompositorLaunchClient( mWCtx, mCmd.cString() ) )
if ( mWCtx && !WstCompositorLaunchClient( mWCtx, mCmd.cString() ) )
{
rtLogError( "pxWayland::launchAndMonitorClient: WstCompositorLaunchClient failed for (%s)", mCmd.cString() );
const char *detail= WstCompositorGetLastErrorDetail( mWCtx );
Expand Down