aboutsummaryrefslogtreecommitdiff
path: root/include/datetime
diff options
context:
space:
mode:
Diffstat (limited to 'include/datetime')
-rw-r--r--include/datetime/date-time.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/datetime/date-time.h b/include/datetime/date-time.h
index 5b9421f..33f8b40 100644
--- a/include/datetime/date-time.h
+++ b/include/datetime/date-time.h
@@ -38,7 +38,11 @@ public:
explicit DateTime(GDateTime* in=nullptr) { reset(in); }
- explicit DateTime(time_t t) { reset(g_date_time_new_from_unix_local(t)); }
+ explicit DateTime(time_t t) {
+ GDateTime * gdt = g_date_time_new_from_unix_local(t);
+ reset(gdt);
+ g_date_time_unref(gdt);
+ }
static DateTime NowLocal() {
GDateTime * gdt = g_date_time_new_now_local();