} else {
var this_type = get_this_type ();
if (this_type != null) {
+ this_type = this_type.copy ();
+ this_type.value_owned = true;
if (this_type.is_disposable () && !is_in_destructor ()) {
// reference count for self is not increased in finalizers
var this_value = new GLibValue (get_data_type_for_symbol (current_type_symbol), new CCodeIdentifier ("self"), true);
delegate int Func ();
+class Foo : Object {
+ public void bar (MainLoop loop) {
+ Object o = new Object ();
+ SourceFunc f = () => {
+ o = null;
+ loop.quit ();
+ return false;
+ };
+ GLib.Idle.add ((owned) f);
+ }
+}
+
[CCode (has_target = false)]
delegate void NoTargetFunc ();
void main () {
int result = A (10, () => 1, () => -1, () => -1, () => 1, () => 0);
assert (result == -67);
+
+ var foo = new Foo ();
+ var loop = new MainLoop ();
+ foo.bar (loop);
+ loop.run ();
+ assert (foo.ref_count == 1);
}