mirror of
https://github.com/profanity-im/profanity.git
synced 2025-07-26 12:14:28 -04:00
Dereference timestamp on chat logging
This commit is contained in:
parent
d501576fcf
commit
dea10ecfdc
@ -380,7 +380,11 @@ _chat_log_chat(const char * const login, const char * const other,
|
|||||||
g_hash_table_replace(logs, strdup(other), dated_log);
|
g_hash_table_replace(logs, strdup(other), dated_log);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (timestamp == NULL) timestamp = g_date_time_new_now_local();
|
if (timestamp == NULL) {
|
||||||
|
timestamp = g_date_time_new_now_local();
|
||||||
|
} else {
|
||||||
|
g_date_time_ref(timestamp);
|
||||||
|
}
|
||||||
|
|
||||||
gchar *date_fmt = g_date_time_format(timestamp, "%H:%M:%S");
|
gchar *date_fmt = g_date_time_format(timestamp, "%H:%M:%S");
|
||||||
FILE *logp = fopen(dated_log->filename, "a");
|
FILE *logp = fopen(dated_log->filename, "a");
|
||||||
@ -407,6 +411,7 @@ _chat_log_chat(const char * const login, const char * const other,
|
|||||||
}
|
}
|
||||||
|
|
||||||
g_free(date_fmt);
|
g_free(date_fmt);
|
||||||
|
g_date_time_unref(timestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user