Fix a crash.
ClosedPublic

Authored by meven on Apr 14 2019, 3:09 PM.

Details

Reviewers
dvratil
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
R488:2c5c6494bb6a: Fix a crash.
Summary

Fix a regression introduced in D20379

Test Plan

Compiles and runs

Diff Detail

Repository
R488 Phonon: GStreamer backend
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
meven created this revision.Apr 14 2019, 3:09 PM
Owners added a reviewer: Restricted Owners Package.Apr 14 2019, 3:09 PM
meven requested review of this revision.Apr 14 2019, 3:09 PM
meven added a comment.Apr 14 2019, 3:10 PM
g_object_set_property(G_OBJECT(m_pipeline->element()),
-   "suburi", NULL);

g_object_set_property will crash when third argument is NULL...

dvratil accepted this revision.Apr 15 2019, 8:20 AM

Hmm, this is weird, GObject documentation does not say anything about g_object_set_property not allowing a NULL value or even crashing. Do you have a backtrace? I'm actually quite interested where it crashes (if it's a Gst bug or just an undocumented GObject quirk).

I assume you tested this and it does work without a crash with g_object_set.

This revision is now accepted and ready to land.Apr 15 2019, 8:20 AM
meven added a comment.Apr 15 2019, 9:40 AM

Hmm, this is weird, GObject documentation does not say anything about g_object_set_property not allowing a NULL value or even crashing. Do you have a backtrace? I'm actually quite interested where it crashes (if it's a Gst bug or just an undocumented GObject quirk).

The documentation says third argument must be a GValue and NULL is not one.
I don't get a backtrace but an explicit assert fail warning from gtk, telling third argument to g_object_set_property is not a GValue before the crash.

I assume you tested this and it does work without a crash with g_object_set.

I have tested this fix but not the "little" prior change to use g_object_set_property that's how the crash got in.

This revision was automatically updated to reflect the committed changes.