]> Pileus Git - ~andy/gtk/blob - gtk/gtkappchoosermodule.c
label: Fix memleak
[~andy/gtk] / gtk / gtkappchoosermodule.c
1 /*
2  * gtkappchoosermodule.c: an extension point for online integration
3  *
4  * Copyright (C) 2010 Red Hat, Inc.
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public License as
8  * published by the Free Software Foundation; either version 2 of the
9  * License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
18  *
19  * Authors: Cosimo Cecchi <ccecchi@redhat.com>
20  */
21
22 #include "config.h"
23
24 #include "gtkappchoosermodule.h"
25
26 #include <gio/gio.h>
27
28 #include "gtkappchooseronline.h"
29
30 #ifdef ENABLE_PACKAGEKIT
31 #include "gtkappchooseronlinepk.h"
32 #endif
33
34 G_LOCK_DEFINE_STATIC (registered_ep);
35
36 void
37 _gtk_app_chooser_module_ensure (void)
38 {
39   static gboolean registered_ep = FALSE;
40   GIOExtensionPoint *ep;
41
42   G_LOCK (registered_ep);
43
44   if (!registered_ep)
45     {
46       registered_ep = TRUE;
47
48       ep = g_io_extension_point_register ("gtkappchooser-online");
49       g_io_extension_point_set_required_type (ep, GTK_TYPE_APP_CHOOSER_ONLINE);
50
51 #ifdef ENABLE_PACKAGEKIT
52       _gtk_app_chooser_online_pk_get_type ();
53 #endif
54     }
55
56   G_UNLOCK (registered_ep);
57 }