Fix module entry deallocation in MODULE_DecRefCount

Warren_Baird at cimmetry.com Warren_Baird at cimmetry.com
Wed Feb 5 17:32:48 CST 2003



ChangeLog:

     Fix module entry deallocation in MODULE_DecRefCount.

Description:

     Also decrement the reference count on any other libraries with
     exactly the same short name since two module entries are being
     allocated when we load the library. Maybe the real fix here would
     be to ensure that a module entry is allocated no more than once
     but we couldn't     figure out how to do that.

Warren Baird : Warren_Baird at cimmetry.com

diff -ur clean/wine/loader/module.c  wine/loader/module.c
--- clean/wine/loader/module.c     Wed Jan 29 15:31:10 2003
+++ wine/loader/module.c Thu Jan 30 16:00:50 2003
@@ -1477,7 +1477,7 @@
 static void MODULE_DecRefCount( WINE_MODREF *wm )
 {
     int i;
-
+    WINE_MODREF *pwm;
     if ( wm->flags & WINE_MODREF_MARKER )
         return;

@@ -1496,6 +1496,21 @@
                 MODULE_DecRefCount( wm->deps[i] );

         wm->flags &= ~WINE_MODREF_MARKER;
+    }
+
+    // Also decrement the reference count on any other libraries with
+    // exactly the same short name since two module entries are
+    // being allocated when we load the library. FIXME???
+
+    for (pwm = MODULE_modref_list; pwm; pwm = pwm->next )
+    {(pwm
+        if ( (pwm != wm) &&
+               (!FILE_strcasecmp( pwm->short_modname, wm->short_modname ) ) ) {
+
+              if (pwm->refCount > 0) {
+                   pwm->refCount--;
+              }
+         }
     }
 }






More information about the wine-patches mailing list