Notifications
Clear all

[Closed] Weird dialog destruction sequence

Hi,

I’m writing a renderer plugin. AppleseedRendererParamDlg is the dialog for the renderer’s parameters. It inherits from RendParamDlg.

I’ve noticed something weird in the sequence of events when the dialog is destructed: it looks like the AppleseedRendererParamDlg::DeleteThis() method is called before the WM_DESTROY message is received, where we need a valid pointer to the dialog in order to call destroy_dialog().

One obvious solution is to destroy the dialog in the destructor of AppleseedRendererParamDlg, i.e. when DeleteThis() is called. What bothers me is that it seems like I’m doing everything like I should, and the SDK examples seem to be doing the same thing as me, yet there is clearly a problem in that sequence of event.

Maybe I’m doing something wrong?