Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Thread Search crashes by design. RFC about proposed changes to events in SDK
Miguel Gimenez:
The Thread Search makes C::B crash when changing it to disabled (see ticket 777)
https://sourceforge.net/p/codeblocks/tickets/777/
This is because it sends a cbEVT_REMOVE_LOG_WINDOW event (who calls DeletePage() from the infopane which in turn deletes the page) and then tries to call Reparent() of the deleted page.
So the cbEVT_REMOVE_LOG_WINDOW name is misleading, as it deletes the page instead of removing.
I suggest creating a cbEVT_DELETE_LOG_WINDOW event with the actual behaviour of cbEVT_REMOVE_LOG_WINDOW and change the latter so it calls RemoveNonLogger() (already existent but currently unused) instead of DeleteNonLogger().
There are 12 uses of cbEVT_REMOVE_LOG_WINDOW in assorted plugins that can be simply renamed, leaving Thread Search use as is.
Miguel Gimenez:
This patch contains the proposed changes. ThreadSearch now works as it should and the other plugins are not affected because for them the change is only a rename.
I don't know if these changes affect the SDK API.
oBFusCATed:
I'm not sure adding another event and modifying all plugins is worth it...But I don't have the time to really investigate how to properly fix this.
ollydbg:
I'm not familiar with such part, but look at the patch:
--- Code: ---@@ -443,6 +443,9 @@
// remove a log window
extern EVTIMPORT const wxEventType cbEVT_REMOVE_LOG_WINDOW;
#define EVT_REMOVE_LOG_WINDOW(fn) DECLARE_EVENT_TABLE_ENTRY( cbEVT_REMOVE_LOG_WINDOW, -1, -1, (wxObjectEventFunction)(wxEventFunction)(CodeBlocksLogEventFunction)&fn, (wxObject *) NULL ),
+// delete a log window
+extern EVTIMPORT const wxEventType cbEVT_DELETE_LOG_WINDOW;
+#define EVT_DELETE_LOG_WINDOW(fn) DECLARE_EVENT_TABLE_ENTRY( cbEVT_DELETE_LOG_WINDOW, -1, -1, (wxObjectEventFunction)(wxEventFunction)(CodeBlocksLogEventFunction)&fn, (wxObject *) NULL ),
--- End code ---
People will get puzzled when they see "remove" and "delete" a log window. So, maybe a better event name?
Miguel Gimenez:
I didn't invent them, the names are chosen to match wxNotebook's method names:
- cbEVT_REMOVE_LOG_WINDOW at the end calls Notebook::RemovePage()
- cbEVT_DELETE_LOG_WINDOW at the end calls Notebook::DeletePage()
Previously the cbEVT_REMOVE_LOG_WINDOW called DeletePage() and not RemovePage(), which is a lot confusing and fooled ThreadSearch's author to think the window was still usable after removing it.
Of course the comment is too terse, I'll change them to
REMOVE: // removes the specified window from the log but does not delete it
DELETE: // removes the specified window from the log and deletes it
Navigation
[0] Message Index
[#] Next page
Go to full version