-    // translating into wxFDIOHandler
-    // XXX this is a memory leak of course, but this is really temporary, so
-    // we are not creating another map of handlers
-    wxFDIOHandler* h = new wxFDIOEventLoopSourceHandler(source->GetHandler());
+    // we need a bridge to wxFDIODispatcher
+    //
+    // TODO: refactor the code so that only wxEventLoopSourceHandler is used
+    wxScopedPtr<wxFDIOHandler>
+        fdioHandler(new wxFDIOEventLoopSourceHandler(handler));