GNOME Bugzilla – Bug 722021
src/librygel-renderer-gst/rygel-playbin-player.vala: non-void function should return a value
Last modified: 2014-02-23 16:30:01 UTC
In src/librygel-renderer-gst/rygel-playbin-player.vala, the function Player.wrap use return_if_fail, which should be replaced by return_val_if_fail.
I think we can remove the first check: return_if_fail (playbin != null); Vala does this already. The second one is trickier... I think returning early in a constructor leads to the object being leaked -- this happens with current code as well of course.
Yeah, that leaks, looking at the C code.
Although I would like to remove that constructor. Wrapping random pipelines doesn't really work well.
Created attachment 268569 [details] [review] renderer-gst: Deprecate element wrapping The function causes leaks in the error case and secondly, wrapping an existing pipeline is not as helpful as I thought it would be. Signed-off-by: Jens Georg <mail@jensge.org>
Attachment 268569 [details] pushed as d276d78 - renderer-gst: Deprecate element wrapping
The patch does not fix the problem. I still get error when compiling rygel with clang.
Ehm, you somehow omitted the part in the bug description that it fails to compile for you.
"non-void function should return a value" is an error in clang.
actually, return_val_if_fail doesn't leak because it happens before the g_object_new
Created attachment 270056 [details] [review] renderer-gst: Return null in error case This is slightly bad since this is a constructor; we can safely return here because the C code has not executed the constructor yet. As the function was deprecated anyway with an earlier commit, beaty doesn't really matter. Signed-off-by: Jens Georg <mail@jensge.org>
Attachment 270056 [details] pushed as 58c3ba9 - renderer-gst: Return null in error case