Skip to content

Commit

Permalink
Bug 1676022 - Silence some glib deprecation warnings, r=stransky
Browse files Browse the repository at this point in the history
  • Loading branch information
rmader committed Nov 9, 2020
1 parent ed1f2ea commit ce8b2c9
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 46 deletions.
4 changes: 0 additions & 4 deletions toolkit/components/downloads/DownloadPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ DownloadPlatform* DownloadPlatform::GetDownloadPlatform() {

NS_ADDREF(gDownloadPlatformService);

#if defined(MOZ_WIDGET_GTK)
g_type_init();
#endif

return gDownloadPlatformService;
}

Expand Down
6 changes: 0 additions & 6 deletions toolkit/system/gnome/components.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

InitFunc = 'mozilla::InitGType'

Headers = [
'/toolkit/system/gnome/nsGnomeModule.h',
]

Classes = [
{
'cid': '{e3a1f3c9-3ae1-4b40-a5e0-7b457fc9a9ad}',
Expand Down
1 change: 0 additions & 1 deletion toolkit/system/gnome/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ with Files("**"):

SOURCES += [
"nsAlertsIconListener.cpp",
"nsGnomeModule.cpp",
"nsSystemAlertsService.cpp",
]

Expand Down
15 changes: 0 additions & 15 deletions toolkit/system/gnome/nsGnomeModule.cpp

This file was deleted.

10 changes: 0 additions & 10 deletions toolkit/system/gnome/nsGnomeModule.h

This file was deleted.

6 changes: 0 additions & 6 deletions widget/gtk/nsAppShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,6 @@ nsAppShell::~nsAppShell() {
}

nsresult nsAppShell::Init() {
// For any versions of Glib before 2.36, g_type_init must be explicitly called
// to safely use the library. Failure to do so may cause various
// failures/crashes in any code that uses Glib, Gdk, or Gtk. In later versions
// of Glib, this call is a no-op.
g_type_init();

mozilla::hal::Init();

#ifdef MOZ_ENABLE_DBUS
Expand Down
8 changes: 4 additions & 4 deletions widget/gtk/nsSound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,10 @@ struct ScopedCanberraFile {
static ca_context* ca_context_get_default() {
// This allows us to avoid race conditions with freeing the context by handing
// that responsibility to Glib, and still use one context at a time
static GStaticPrivate ctx_static_private = G_STATIC_PRIVATE_INIT;
static GPrivate ctx_private =
G_PRIVATE_INIT((GDestroyNotify)ca_context_destroy);

ca_context* ctx = (ca_context*)g_static_private_get(&ctx_static_private);
ca_context* ctx = (ca_context*)g_private_get(&ctx_private);

if (ctx) {
return ctx;
Expand All @@ -95,8 +96,7 @@ static ca_context* ca_context_get_default() {
return nullptr;
}

g_static_private_set(&ctx_static_private, ctx,
(GDestroyNotify)ca_context_destroy);
g_private_set(&ctx_private, ctx);

GtkSettings* settings = gtk_settings_get_default();
if (g_object_class_find_property(G_OBJECT_GET_CLASS(settings),
Expand Down

0 comments on commit ce8b2c9

Please sign in to comment.