[haiku-development] Re: BFilePanel: Undefined reference to..

Hi James,

James Kim wrote:
> void
> EditForm::MessageReceived(BMessage* message)
> {
>   switch (message->what) {
>     ...
>     case M_SAVE_DIALOG: {
>       if (!fPanel) {
>         fPanel = new BFilePanel(B_SAVE_PANEL, new BMessenger(this)); ...

Unfortunately the BeBook is not explicit about it and the API isn't helpful 
either, it should have been "const BMessenger* target"... the above code 
will leak the BMessenger created with "new". Correct would be:

>         BMessenger target(this);
>         fPanel = new BFilePanel(B_SAVE_PANEL, &target); ...

Best regards,
-Stephan

Other related posts: