--- rpl/modules/motif/XtAppMainLoop.rplc 2017/07/06 10:18:04 1.2 +++ rpl/modules/motif/XtAppMainLoop.rplc 2017/07/17 21:35:32 1.3 @@ -15,11 +15,14 @@ declareExternalFunction(XtAppMainLoop) pullFromStack(appObject, external); returnOnError(freeObject(appObject)); - if (subType(appObject) ne APPCONTEXT) then + ifIsExternal(appObject, APPCONTEXT) then + orElse executionError("Type mismatch"); returnOnError(freeObject(appObject)); endIf + intrinsic(pshcntxt); + doUntil if (XtAppPending(target((sXtAppContext *) objectContainer(appObject)).context) ne 0) then @@ -45,6 +48,8 @@ declareExternalFunction(XtAppMainLoop) (stopRequest eq -1) or (exitMainLoop ne 0)) + intrinsic(pulcntxt); + XtDestroyApplicationContext(target((sXtAppContext *) objectContainer(appObject)).context); orElse