[haiku-webkit-commits] r375 - webkit/trunk/WebKit/haiku/API

  • From: webkit@xxxxxxxxxxxxxxx
  • To: haiku-webkit-commits@xxxxxxxxxxxxx
  • Date: Fri, 02 Apr 2010 23:22:55 +0000

Author: stippi
Date: Fri Apr  2 23:22:55 2010
New Revision: 375
URL: http://mmlr.dyndns.org/changeset/375

Log:
Don't leak the BFilePanel objects anymore. Eventually one panel should be 
re-used.

Modified:
   webkit/trunk/WebKit/haiku/API/WebPage.cpp

Modified: webkit/trunk/WebKit/haiku/API/WebPage.cpp
==============================================================================
--- webkit/trunk/WebKit/haiku/API/WebPage.cpp   Fri Apr  2 23:13:38 2010        
(r374)
+++ webkit/trunk/WebKit/haiku/API/WebPage.cpp   Fri Apr  2 23:22:55 2010        
(r375)
@@ -73,6 +73,7 @@
 
 #include <Bitmap.h>
 #include <Entry.h>
+#include <FilePanel.h>
 #include <FindDirectory.h>
 #include <Font.h>
 #include <Message.h>
@@ -931,6 +932,18 @@
         }
        break;
     }
+    case B_CANCEL: {
+       int32 oldWhat;
+       BFilePanel* panel;
+       if (message->FindPointer("source", reinterpret_cast<void**>(&panel)) == 
B_OK
+               && message->FindInt32("old_what", &oldWhat) == B_OK
+               && oldWhat == B_REFS_RECEIVED) {
+               // TODO: Eventually it would be nice to reuse the same file 
panel...
+               // At least don't leak the file panel for now.
+               delete panel;
+       }
+       break;
+    }
 
     default:
         BHandler::MessageReceived(message);

Other related posts:

  • » [haiku-webkit-commits] r375 - webkit/trunk/WebKit/haiku/API - webkit