Skip to content
This repository was archived by the owner on Jun 8, 2021. It is now read-only.

Commit 665b910

Browse files
committed
Always ref-sink after g_object_new() if the type inherits from GInitiallyUnowned
Independent of it still being actually floating or not. Fixes #483
1 parent 6d26056 commit 665b910

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/object.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,7 @@ impl Object {
882882
let ptr = gobject_sys::g_object_newv(type_.to_glib(), params_c.len() as u32, mut_override(params_c.as_ptr()));
883883
if ptr.is_null() {
884884
Err(glib_bool_error!("Can't instantiate object"))
885-
} else if gobject_sys::g_object_is_floating(ptr) != glib_sys::GFALSE {
885+
} else if type_.is_a(&InitiallyUnowned::static_type()) {
886886
Ok(from_glib_none(ptr))
887887
} else {
888888
Ok(from_glib_full(ptr))

0 commit comments

Comments
 (0)