On Sun, 22 Oct 2000, Lars Gullik Bjønnes wrote:
> Angus Leeming <[EMAIL PROTECTED]> writes:
> | > void FormCommand::showInset( InsetCommand & inset )
> | > {
> | >   inset_ = &inset;
> | >   ...
> | > }
>
> This is not safe, ... just imagine what will happen if the
> InsetCommand goes out of scope or is deleted.

Yes it is safe!
If the InsetCommand goes out of scope, then its destructor is called. The 
destructor emits a "hide dialog" signal that does just that and also resets 
the dialog member variable inset_=0. This is EXACTLY what the variable is 
designed for.

Angus

Reply via email to