kdebase/nsplugins/viewer

George Staikos staikos at kde.org
Fri Feb 28 06:25:04 GMT 2003


CVS commit by staikos: 

Fixes the crashes without removing the cleanup code, at least for me.
It appears that the plugin was not getting destroyed until after the drawing
area was, if at all!!  I'm not sure why this was removed, nor am I sure why
the plugins were deleted in a [single shot equivalent] timer instead of
immediately.

This is just a workaround the timer code for now.  I'll clean it up later if
this is a good fix.  It still seems to grow without bounds, but that might be
a flash bug as much as anything.  I think it might be reasonable to put a
death counter in nspluginviewer and kill it off after n plugin loads, just
to be safe.  Anyone against that?

CCMAIL: kfm-devel at mail.kde.org, hetz at kde.org


  M +6 -4      nsplugin.cpp   1.84


--- kdebase/nsplugins/viewer/nsplugin.cpp  #1.83:1.84
@@ -464,4 +464,6 @@ void NSPluginInstance::destroy()
         _waitingRequests.clear();
 
+        shutdown();
+
         for( NSPluginStreamBase *s=_streams.first(); s!=0; ) {
             NSPluginStreamBase *next = _streams.next();
@@ -495,5 +497,4 @@ void NSPluginInstance::destroy()
           g_NPN_MemFree(saved);
 
-#if 0
         XtRemoveEventHandler(_form, (KeyPressMask|KeyReleaseMask), 
                              False, forwarder, (XtPointer)this);
@@ -501,7 +502,9 @@ void NSPluginInstance::destroy()
                              False, forwarder, (XtPointer)this);
         XtDestroyWidget(_area);
+        _area = 0;
         XtDestroyWidget(_form);
+        _form = 0;
         XtDestroyWidget(_toplevel);
-#endif
+        _toplevel = 0;
 
         ::free(_npp);   // matched with malloc() in newInstance
@@ -985,5 +988,4 @@ NSPluginClass::~NSPluginClass()
     _trash.clear();
     shutdown();
-    //KLibLoader::self()->unloadLibrary( QFile::encodeName(libname) );
     if (_handle)
       _handle->unload();
@@ -1134,5 +1136,5 @@ void NSPluginClass::destroyInstance( NSP
     // mark for destruction
     _trash.append( inst );
-    _timer->start( 0, TRUE );
+    timer(); //_timer->start( 0, TRUE );
 }
 






More information about the kfm-devel mailing list