if (klass->create_element)
element = klass->create_element (device, name);
- if (element) {
+ if (element && !g_object_is_floating ((GObject *) element)) {
/* The reference we receive here should be floating, but we can't force
- * it at our level. Simply assert to make the issue obvious to bindings
+ * it at our level. Simply raise a critical to make the issue obvious to bindings
* developers */
- g_assert (g_object_is_floating ((GObject *) element));
+ g_critical ("The created element should be floating, "
+ "this is probably caused by faulty bindings");
}
return element;
/* This ref will never be dropped as the class is never destroyed */
GST_OBJECT_FLAG_SET (factory, GST_OBJECT_FLAG_MAY_BE_LEAKED);
- /* The reference we receive here should be floating, but we can't force
- * it at our level. Simply assert to make the issue obvious to bindings
- * developers */
- g_assert (g_object_is_floating ((GObject *) element));
+ if (!g_object_is_floating ((GObject *) element)) {
+ /* The reference we receive here should be floating, but we can't force
+ * it at our level. Simply raise a critical to make the issue obvious to bindings
+ * users / developers */
+ g_critical ("The created element should be floating, "
+ "this is probably caused by faulty bindings");
+ }
+
GST_DEBUG ("created element \"%s\"", GST_OBJECT_NAME (factory));