After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 97948 - libgstplay : GstPlay can not be unrefed with g_object_unref
libgstplay : GstPlay can not be unrefed with g_object_unref
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins
git master
Other Linux
: Normal normal
: 0.4.0
Assigned To: Steve Baker
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2002-11-07 19:01 UTC by Julien MOUTTE
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch fixing dispose methods and uncleaned callbacks (7.72 KB, patch)
2003-01-07 11:15 UTC, Julien MOUTTE
none Details | Review

Description Julien MOUTTE 2002-11-07 19:01:14 UTC
I tried something like this :

void destroy_play (GstPlay * play) {

g_return_val_if_fail (GST_IS_PLAY(play), FALSE);

g_object_unref (play);

return;

}

It throws a lot of errors like :

GLib-GObject-WARNING **: invalid uninstantiatable type `(null)' in cast to
`GObject'

GLib-GObject-WARNING **: instance of invalid non-instantiatable type
`<invalid>'

GLib-GObject-CRITICAL **: file gsignal.c: line 2036 (g_signal_emit_valist):
assertion `G_TYPE_CHECK_INSTANCE (instance)' failed

Please help :) I need to be able to destroy GstPlay objects or 1GB RAM
won't be enough to run my app
Comment 1 Leif Johnson 2002-12-07 19:23:12 UTC
(Sorry if this is way out in left field, but I don't have a good way
to test at the moment.) I have two questions/suggestions :

1. Don't calls like this commonly use an explicit cast to the proper
object type ? Have you tried g_object_unref (G_OBJECT (play)); ?

2. Is play a GObject or GstObject ? I would suggest using
gst_object_unref (GST_OBJECT (play)); if this object is in the
GStreamer object hierarchy. Also, use a cast here as well.
Comment 2 Thomas Vander Stichele 2003-01-05 16:59:44 UTC
I'd also suggest to not unref in the callback, but set a boolean and
unref in an idler or something.
Please reply to leif's suggestion as well, otherwise we'll close the bug.
Comment 3 Julien MOUTTE 2003-01-06 20:12:37 UTC
So...

GstPlay inherits from a GObject... the g_object_unref function works
as expected the problem is somewherelse...

Indeed when unrefing the GstPlay object a SIGSEGV is raised from a
timetick function trying to access the GstPlay. The uninstantiable
type errors are coming from this unrefed object that the timetick
function tries to access..

I'll try to figure out how the unrefing function could destroy the
threads that might be running which will try to access the GstPlay
object later...

Any help appreciated
Comment 4 Julien MOUTTE 2003-01-07 11:15:39 UTC
Created attachment 13401 [details] [review]
Patch fixing dispose methods and uncleaned callbacks
Comment 5 Julien MOUTTE 2003-01-07 11:16:06 UTC
Ok Guys ...

Here is the patch to solve those issues...

I've changed a lot of stuff in libgstplay to clean the timers and idle
handler that were launched and never cleaned...

Now when i m unrefing the GstPlay object all callbacks are cleared,
object disposed and no warning...

Enjoy !