Dialogs example throws error on MorphOS
Posted: Sat Aug 07, 2021 10:44 pm
When running the "Dialogs" example on MorphOS and activating MorphOS' debug log (Debug.sbar), it will output the following error when clicking "Cancel" in the "Add customer" dialog:
Same with the "OK" button:
I investigated some further and found out that the reason is the calling of "p_CloseDialog()" (which invokes the "Dialog.EndModal" method) directly from the "p_EventFunc(msg)" function.
Replacing "p_CloseDialog" with "RunCallback(p_CloseDialog)" on line 257 and 268 solves the issue. Not sure if this is a MorphOS-MUI-only issue or if this is something that MUI doesn't like on other platforms, either.
I would suggest to adjust the "Dialogs" example accordingly for the next RapaGUI release and to mention in the RapaGUI docs on the "Dialog.EndModal" page, that this method mustn't be called directly from the event handler but to use RunCallback() instead.
Cheers, Michael
Code: Select all
Notify_DISPOSE : ################################################################
Notify_DISPOSE : MAJOR BUG: object dispose from it's own OM_SET method,
Notify_DISPOSE : probably in an illegal notification. NOT freeing memory!
Notify_DISPOSE : obj=0x2665bb28(0x26049f1c_Text.mui)Cancel
Code: Select all
Notify_DISPOSE : ################################################################
Notify_DISPOSE : MAJOR BUG: object dispose from it's own OM_SET method,
Notify_DISPOSE : probably in an illegal notification. NOT freeing memory!
Notify_DISPOSE : obj=0x26659150(0x26049f1c_Text.mui)OK
Replacing "p_CloseDialog" with "RunCallback(p_CloseDialog)" on line 257 and 268 solves the issue. Not sure if this is a MorphOS-MUI-only issue or if this is something that MUI doesn't like on other platforms, either.
I would suggest to adjust the "Dialogs" example accordingly for the next RapaGUI release and to mention in the RapaGUI docs on the "Dialog.EndModal" page, that this method mustn't be called directly from the event handler but to use RunCallback() instead.
Cheers, Michael