[Plib-users] RE: Crash while deleting puDialogBox... access violation
Brought to you by:
sjbaker
From: McEvoy, N. <nic...@ds...> - 2003-04-02 00:44:59
|
Ralf Pietersz wrote: >I have a strange crash I dont really understand... >If there is anyone that has experienced something similar and knows a >solution please speak up. :) >Basicly, I create a dialogbox, and close it when the callback for the >button inside it is called. >Once it closes I get a crash, access violation. >Traceback: >puOneShot::doHit(int 0, int 1, int 243, int 34) line 33 + 12 bytes >puObject::checkHit(int 0, int 1, int 243, int 34) line 508 + 29 bytes >puGroup::checkHit(int 0, int 1, int 243, int 34) line 212 + 29 bytes >puMouse(int 0, int 1, int 394, int 316) line 378 + 42 bytes >mouse(int 0, int 1, int 394, int 316) line 1004 + 21 bytes >FREEGLUT! 0089661d() <snip> I've only just started using the pui ... so I'm no expert (although I've been using plib for years) ... but I do remember I had a similar problem as you describe. What I found was that the puMouse(button, state, x, y) callback was arriving after dialog was deleted !? I'm not sure if it was a timing issue in my code, or a bug in the pui ... where maybe it doesn't correctly check if the dialog exists when checking hits (if I remember correctly it seemed to happen on the mouse up event). In my case *maybe* it was a timing issue (but I'm not convinced yet) ... I changed my code as follows to delete the dialog after an intensive load operation (and a redraw ... maybe the redraw is the solution ... I'm just guessing here): on mouse down: - closed & deleted dialog - loaded level (+ redraw) - crash occurred (similar to your description) on mouse down: - hide dialog - loaded level (+ redraw) - deleted dialog - no problems Sorry I can't be more helpful than that. Let us know what you find. >Do I need to tell PUI I am deleting that dialogbox AND the buttons >inside it?? >Clean something up? Pop some interface from the stack?? No, I don't think so. Nick |