aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/error.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/error.h')
-rw-r--r--src/error.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/error.h b/src/error.h
index 9029b86..3eb584c 100644
--- a/src/error.h
+++ b/src/error.h
@@ -147,8 +147,16 @@ public:
class GlibError : public Error {
public:
- GlibError(const GError *gerror)
- : Error("%s", gerror->message) {}
+ /**
+ * Construct error for glib's GError.
+ * Ownership of the error's resources is passed
+ * the GlibError object.
+ */
+ GlibError(GError *gerror)
+ : Error("%s", gerror->message)
+ {
+ g_error_free(gerror);
+ }
};
class SyntaxError : public Error {