GNOME Bugzilla – Bug 781904
gtk-play: crashes and gtk api fixes
Last modified: 2017-05-02 11:12:51 UTC
In this bug are attached a couple patches for gtk-play: two fixes for crashes and one GTK+ API udpate.
Created attachment 350655 [details] [review] playback/player: don't unref gtk_sink but sink it Commit 5b8ba60c was added because of a memory leak when gtksink was used as renderer. Nonetheless the patch didn't consider two facts: 1\ that the gtk_sink element was in floating state 2\ there is another code path where the gtk_sink element is already sank Thus the correct fix, is not to ref and unref gtk_sink, but sink it.
Created attachment 350656 [details] [review] playback/player: don't unref a contained widget In the GTK+ model, when a wiget is created, it is floating, thus when it is added to a widget container, this container is the owner of the widget. The video_area widget is created in two different paths: 1\ when the renderer element is also a GTK+ widget and we are the owners. 2\ when the renderer element is an overlay an video area a new widget owned by the container. In the first code path, there was a memory leak fixed on commit f8d4796a, but it didn't consider the second path, leading to a segmentation fault because the owner of the widget is not us. This patch unrefs early the video area widget in the first path avoiding to unref it twice in the second path.
Created attachment 350657 [details] [review] playback/player: gtk_menu_popup() is deprecated gtk_menu_popup() is deprecated in GTK+ 3.22. This patch adds a compiler guard to use gtk_menu_popup at pointer() if GTK+ is 3.22 or bigger.
Attachment 350655 [details] pushed as ff1a654 - playback/player: don't unref gtk_sink but sink it Attachment 350656 [details] pushed as dbb0375 - playback/player: don't unref a contained widget Attachment 350657 [details] pushed as d909dea - playback/player: gtk_menu_popup() is deprecated