[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/4.4/kdebindings/ruby
From:       Arno Rehn <kde () arnorehn ! de>
Date:       2010-01-31 13:32:52
Message-ID: 1264944772.364767.6697.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1082907 by arnorehn:

backport from trunk:
Never set KSharedPtr's 'allocated' field to true.
The bindings runtime would think it has created the object
and delete it when it's not in use anymore. Native C++ code trying
to access that pointer afterwards will consequently crash.


 M  +3 -3      korundum/src/kdehandlers.cpp  
 M  +1 -1      plasma/src/plasmahandlers.cpp  


--- branches/KDE/4.4/kdebindings/ruby/korundum/src/kdehandlers.cpp #1082906:1082907
@@ -96,7 +96,7 @@
 		    o->smoke = m->smoke();
 		    o->classId = m->smoke()->idClass("KService").index;
 		    o->ptr = service;
-		    o->allocated = true;
+		    o->allocated = false;
 		    obj = set_obj_info("KDE::Service", o);
 		}
 
@@ -138,7 +138,7 @@
 		    o->smoke = m->smoke();
 		    o->classId = m->smoke()->idClass("KSharedConfig").index;
 		    o->ptr = config;
-		    o->allocated = true;
+		    o->allocated = false;
 		    obj = set_obj_info("KDE::SharedConfig", o);
 		}
 
@@ -181,7 +181,7 @@
 		    o->smoke = m->smoke();
 		    o->classId = m->smoke()->idClass("KMimeType").index;
 		    o->ptr = config;
-		    o->allocated = true;
+		    o->allocated = false;
 		    obj = set_obj_info("KDE::MimeType", o);
 		}
 
--- branches/KDE/4.4/kdebindings/ruby/plasma/src/plasmahandlers.cpp #1082906:1082907
@@ -49,7 +49,7 @@
             o->smoke = m->smoke();
             o->classId = m->smoke()->idClass("Plasma::PackageStructure").index;
             o->ptr = package;
-            o->allocated = true;
+            o->allocated = false;
             obj = set_obj_info("Plasma::PackageStructure", o);
         }
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic