zerotypic / ipyida

IPython console integration for IDA Pro
Other
2 stars 0 forks source link

Crashes when attempting to focus on widget that was closed #1

Closed zerotypic closed 3 years ago

zerotypic commented 3 years ago

IPythonConsole keeps track of the widget that was in focus before it was activated, and when "Esc" is pressed, returns focus to that widget. However, if that widget gets deleted, e.g. when it is closed, IDA will crash upon trying to access the saved SWIG TWidget* object.

To fix this, we either need a way to determine if a TWidget is valid or not, or we need to hook onto the closing code of the associated widget, such that we remove our reference to it if it's being deleted. Alternatively, we could avoid saving a reference to the TWidget, and just save the title of the widget, which we could then look up using find_widget().

gaasedelen commented 3 years ago

Oops, I didn't see this before I left my comment on the commit. Here's some more context: https://github.com/zerotypic/ipyida/commit/5012697a86d59b6b6a42eed8561480c66c8c5f44#commitcomment-44226610

Yes, I think it's probably safest to simply save the widget title/caption and try to look it up again.

zerotypic commented 3 years ago

Changed to use the widget title. Closing.