Is there any way to get SDK API message when Ida Pro is closing? I write plug-in that connect with other application and I need to close connections when IDA is closing.
Your plugin class can implement the
term(self) method, which will be called when IDA unloads the plugin. Unloading a plugin might happen at different occasions depending on the value returned by your
init(self) method when the plugin was loaded.
You should note the plugin may be loaded and unloaded several times during the execution of a single IDA instance, though. For example a plugin may be loaded once when IDA first starts without a loaded binary, and then be unloaded and reloaded when a binary is loaded (either an IDB or a binary loaded and analyzed for the first time).
The second way to solve the problem with getting close message is create
term(self) method in the UIHook class but not in plugin class.
The benefit of this way that is it usable with ida pro scripts not just plugins.