[Kde-bindings] KDE/kdebindings/ruby
Arno Rehn
kde at arnorehn.de
Sun Jan 31 13:31:30 UTC 2010
SVN commit 1082906 by arnorehn:
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.
CCMAIL: kde-bindings at kde.org
M +3 -3 korundum/src/kdehandlers.cpp
M +1 -1 plasma/src/plasmahandlers.cpp
--- trunk/KDE/kdebindings/ruby/korundum/src/kdehandlers.cpp #1082905:1082906
@@ -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);
}
--- trunk/KDE/kdebindings/ruby/plasma/src/plasmahandlers.cpp #1082905:1082906
@@ -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);
}
More information about the Kde-bindings
mailing list