Skip to content
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