Geary.Util.Logging.Source: Fix GLib old_val > 0 critical
If a source object prints a log message from a destructor the engine's logging hander will attempt to ref it despite the object bing finalised, resulting in the critical. Fixes #650
This commit is contained in:
parent
8dfa262481
commit
8c43288bd0
1 changed files with 4 additions and 1 deletions
|
|
@ -219,7 +219,10 @@ public interface Geary.Logging.Source : GLib.Object {
|
|||
va_list args) {
|
||||
if (flags == ALL || Logging.get_flags().is_any_set(flags)) {
|
||||
Context context = Context(Logging.DOMAIN, flags, levels, fmt, args);
|
||||
Source? decorated = this;
|
||||
// Don't attempt to this object if it is in the middle of
|
||||
// being destructed, which can happen when logging from
|
||||
// the destructor.
|
||||
Source? decorated = (this.ref_count > 0) ? this : this.logging_parent;
|
||||
while (decorated != null) {
|
||||
context.append_source(decorated);
|
||||
decorated = decorated.logging_parent;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue