diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2014-01-22 00:15:34 -0600 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2014-01-22 00:15:34 -0600 |
commit | 74fcc162abf2224bd74e564978afb338252c29ce (patch) | |
tree | 6a9629e4f6ca614660859f50085a0d697bfaafda | |
parent | 74f8897902c99180e721d616614a9962c819d90b (diff) | |
download | ayatana-indicator-datetime-74fcc162abf2224bd74e564978afb338252c29ce.tar.gz ayatana-indicator-datetime-74fcc162abf2224bd74e564978afb338252c29ce.tar.bz2 ayatana-indicator-datetime-74fcc162abf2224bd74e564978afb338252c29ce.zip |
Fix GDateTime leak in DateTime::DateTime(time_t)
-rw-r--r-- | include/datetime/date-time.h | 6 |
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(); |