Plugins: DVPLUGINMSG_CLEAR missed when switching filetypes

Actually I have some strange problems with continuing develop my plugins.

Example #1:
[ul]
[li]I open a csv-file with my csv-viewer -> DVP_CreateViewer will be called -> An instance of my csv-viewer will be created[/li]
[li]I close the csv-viewer -> I will get an DVPLUGINMSG_CLEAR-Message. This is the signal for me, to free all used resources and the plugin-instance itself.[/li][/ul]
Everythink works fine.

Example #2:
[ul]
[li]I open a csv-file with my viewer -> DVP_CreateViewer will be called -> An instance of my csv-viewer will be created[/li]
[li]I do not close my csv-viewer and switch to a jpeg-file. I would not get the DVPLUGINMSG_CLEAR-Message! I have no signal to free my resources not to mention the instance itself![/li]
[li]I switch to a csv-file. A second instance of my cvs-viewer will be created........[/li][/ul]
The result: some exceptions when closing DOpus because the first instance has not been killed.

I have no chance to free resources, when the user switches to another filetype without closing my viewer first :exclamation:

Any ideas?

As soon as I can get my code to compile again (it's in a bit of a state right now making some changes that are trickling down all over the place) I'll take a look at this.

It may also affect the ActiveX plugin since it is (or rather the objects it hosts are) quite particular about when & how it is shut-down.

thx in advance, leo.

I use the WM_NCCDESTROY instead and it works.

But it will be interesting to see, why the DVPLUGINMSG_CLEAR_message does not appear, though.

I put some debug code into the GIF plugin and confirmed what you saw.

Should be fixed in the next Opus release.

Check your PMs for a workaround for now. (Or keep using WM_NCDESTROY if that's working okay, but I've found some components -- ActiveX stuff -- which didn't like being cleaned-up as/after their parent window was destroyed so the DVPLUGINMSG_CLEAR can be important.)