gobject: forbid finalization-during-construction
authorDan Winship <danw@gnome.org>
Mon, 29 Apr 2013 17:04:11 +0000 (13:04 -0400)
committerDan Winship <danw@gnome.org>
Tue, 22 Oct 2013 15:01:15 +0000 (11:01 -0400)
commit0d62eb467f8fbf7a59454bec3498bcdd3c7889e0
tree1fec1523c7aaf8e2209c8dc8eaabe1efc86404a4
parenta7bd6c47db8330fa0b88201ff4d9abf72fb10ef5
gobject: forbid finalization-during-construction

If a constructor() implementation created an object but then unreffed
it rather than returning it, that object would get left on the
construction_objects list, which would cause problems later when that
memory location got reused by another object.

"Fix" this by making it fail intentionally, and add a test for it (and
for the normal, working singleton case).

https://bugzilla.gnome.org/show_bug.cgi?id=661576
gobject/gobject.c
gobject/tests/.gitignore
gobject/tests/Makefile.am
gobject/tests/object.c [new file with mode: 0644]