Fix g_static_private_get/set glib deprecated clang warnings in widget/gtk2/.




6 years ago
5 years ago


(Reporter: karlt, Unassigned)


(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)




6 years ago
+++ This bug was initially created as a clone of Bug #826158 +++

Clang 3.2 gives these warnings in widget/gtk2/:

  widget/gtk2/nsSound.cpp:96:37 [-Wdeprecated-declarations] 'g_static_private_get' is deprecated
  widget/gtk2/nsSound.cpp:107:5 [-Wdeprecated-declarations] 'g_static_private_set' is deprecated

g_static_private_get is marked GLIB_DEPRECATED_IN_2_32_FOR(g_private_get).
I don't get the warning with gcc, even though I have 2.32 here.  I wonder why. says
"GStaticPrivate is a better choice for most uses."
says "GStaticPrivate has been made redundant by adding comparable capabilities to GPrivate." says
"GPrivate is a very limited resource (as far as 128 per program, shared between all libraries). It is also not possible to destroy a GPrivate after it has been used. As such, it is only ever acceptable to use GPrivate in static scope, and even then sparingly so."

Perhaps GPrivate can be used instead of GStaticPrivate now, but
G_PRIVATE_INIT() is only available with older GLib 2.32 and newer, and we
build against older GLib.  And I assume GPrivate does not do the right thing
with older GLib.

Sounds like we should not be using GPrivate if at all possible.

Comment 1

6 years ago
I guess this is a global context on the main thread and the issue is a context
possibly still playing during shutdown.
I wonder whether there is a way to wait (on shutdown) for the sound to finish
Or probably simpler and better, call ca_context_cancel to stop playing the
sounds.  Looks like all sounds have the same id so they are easy to cancel.
I wonder whether _cancel waits for the playing thread.


5 years ago
Summary: Fix three clang warnings in widget/gtk2/. → Fix g_static_private_get/set glib deprecated clang warnings in widget/gtk2/.
You need to log in before you can comment on or make changes to this bug.