Ticket #33: memory-bug.diff
| File memory-bug.diff, 3.2 kB (added by Mike Wey, 7 months ago) |
|---|
-
demos/cairo/cairo_clock/clock.d
old new 63 63 64 64 // This is where we draw on the window 65 65 66 Drawable dr = get Drawable();66 Drawable dr = getWindow(); 67 67 68 68 int width; 69 69 int height; -
wrap/APILookupGObject.txt
old new 172 172 if ( gObject !is null ) 173 173 { 174 174 //writefln("ObjectG.this\n"); 175 176 //Check if there already is a D object for this gtk struct 177 void* ptr = getDObject(gObject); 178 if( ptr !is null ) 179 { 180 this = cast(ObjectG)ptr; 181 return; 182 } 183 175 184 objectGSetDataFull("GObject",cast(void*)this); 176 185 } 177 186 } … … 203 212 } 204 213 } 205 214 215 /** 216 * Gets a D Object from the objects table of associations. 217 * Params: 218 * object = GObject containing the associations. 219 * Returns: the D Object if found, or NULL if no such Object exists. 220 */ 221 public static void* getDObject(GObject* obj) 222 { 223 //gpointer g_object_get_data(GObject *object, const gchar *key); 224 return g_object_get_data(obj, Str.toStringz("GObject")); 225 } 226 206 227 //debug = objectstore; 207 228 // 208 229 //debug(objectstore) … … 380 401 { 381 402 g_object_set( gObject, Str.toStringz(propertyName), value, null); 382 403 } 383 384 404 code: end 385 405 386 406 outFile: ObjectG -
wrap/APILookupGtk.txt
old new 2328 2328 2329 2329 struct: GtkTreeModel 2330 2330 class: TreeModel 2331 extend: GObject 2331 2332 prefix: gtk_tree_model_ 2332 2333 noprefix: gtk_tree_row_reference_ 2333 2334 noprefix: gtk_tree_path_ -
wrap/utils/GtkDClass.d
old new 614 614 text ~= " */"; 615 615 text ~= "public this ("~gtkStruct~"* "~var~")"~iFaceChar; 616 616 text ~= "{"; 617 char[] tabs = "\t\t"; //What is this for? 618 /* Deprecated */ /* 619 text ~= getAssertStructNotNull(var); */ 620 char[][] checkIfNull = [ 617 618 char[][] checkIfNull = [ 621 619 "if("~var~" is null)", 622 620 "{", 623 621 " this = null;", 624 622 " version(Exceptions) throw new Exception(\"Null "~var~" passed to constructor.\");", 625 623 " else return;", 626 624 "}" ]; 625 626 char[][] checkObject = [ 627 "" 628 "//Check if there already is a D object for this gtk struct", 629 "void* ptr = getDObject(cast(GObject*)"~var~");", 630 "if( ptr !is null )", 631 "{", 632 " this = cast("~convParms.clss~")ptr;", 633 " return;", 634 "}" ]; 635 627 636 text ~= checkIfNull; 637 if ( gtkDParentName.length > 0 && gtkDParentName != "Surface" ) 638 text ~= checkObject; 639 628 640 if ( parentName.length > 0 ) 629 641 { 630 642 text ~= "super("~castToParent(var)~");";
