|
From: | Gubinelli Massimiliano |
Subject: | Re: [Texmacs-dev] QT interactive prompt bug (EXC_BAD_ACCESS) + solution |
Date: | Sat, 6 Nov 2010 23:35:49 +0100 |
Hi Miguel, the fix is not quite correct. I've committed an alternative fix. The reasong for the crash is the following (according to my understanding) in QTMInteractivePrompt::exec() 1. you create a temporary status bar 2. you add the prompt to the status bar (so it become children of the status bar, according to docs) 3. you add the status bar to the window (so it become children of the window, according to docs) 4. after execution you remove the status bar from the window (but its parent remains the window) 5. when the status bar is released (somewhere, somehow) it tries to release the interactive prompt which is allocated on the stack (and already freed) so you get the crash. My solution is to reset the parent of the interactive prompt and to explicitly delete the temporary status bar. Usually if you allocate an object you have to be sure that it will be deallocated at appropriate time. Maybe put comments to signal when you think it will be most probably deallocated. Best max On 6 nov. 2010, at 19:20, Miguel de Benito Delgado wrote: It looks like I'm on a roll! ;) First the fix, in case you don't have time to waste on my ramblings: |
[Prev in Thread] | Current Thread | [Next in Thread] |