diff options
Diffstat (limited to 'JavaScriptCore/wtf/gtk')
-rw-r--r-- | JavaScriptCore/wtf/gtk/GOwnPtr.cpp | 7 | ||||
-rw-r--r-- | JavaScriptCore/wtf/gtk/GOwnPtr.h | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/JavaScriptCore/wtf/gtk/GOwnPtr.cpp b/JavaScriptCore/wtf/gtk/GOwnPtr.cpp index 1a151b9..da0d839 100644 --- a/JavaScriptCore/wtf/gtk/GOwnPtr.cpp +++ b/JavaScriptCore/wtf/gtk/GOwnPtr.cpp @@ -19,6 +19,7 @@ #include "config.h" #include "GOwnPtr.h" +#include <gio/gio.h> #include <glib.h> namespace WTF { @@ -57,4 +58,10 @@ template <> void freeOwnedGPtr<GDir>(GDir* ptr) if (ptr) g_dir_close(ptr); } + +template <> void freeOwnedGPtr<GFile>(GFile* ptr) +{ + if (ptr) + g_object_unref(ptr); +} } // namespace WTF diff --git a/JavaScriptCore/wtf/gtk/GOwnPtr.h b/JavaScriptCore/wtf/gtk/GOwnPtr.h index ad2c30e..1fc594c 100644 --- a/JavaScriptCore/wtf/gtk/GOwnPtr.h +++ b/JavaScriptCore/wtf/gtk/GOwnPtr.h @@ -35,6 +35,7 @@ typedef struct _GMutex GMutex; typedef struct _GPatternSpec GPatternSpec; typedef struct _GDir GDir; typedef struct _GHashTable GHashTable; +typedef struct _GFile GFile; extern "C" void g_free(void*); namespace WTF { @@ -47,6 +48,7 @@ template<> void freeOwnedGPtr<GMutex>(GMutex*); template<> void freeOwnedGPtr<GPatternSpec>(GPatternSpec*); template<> void freeOwnedGPtr<GDir>(GDir*); template<> void freeOwnedGPtr<GHashTable>(GHashTable*); +template<> void freeOwnedGPtr<GFile>(GFile*); template <typename T> class GOwnPtr : public Noncopyable { public: |