Fix crash due to gpg binding issue

This commit is contained in:
fiaxh 2023-10-07 16:53:37 +02:00
parent 1e167eeea6
commit 8cb195a274
3 changed files with 6 additions and 3 deletions

View file

@ -117,7 +117,9 @@ public class AccountSettingsEntry : Plugins.AccountSettingsEntry {
new Thread<void*> (null, () => { // Querying GnuPG might take some time new Thread<void*> (null, () => { // Querying GnuPG might take some time
try { try {
keys = GPGHelper.get_keylist(null, true); keys = GPGHelper.get_keylist(null, true);
} catch (Error e) { } } catch (Error e) {
warning(e.message);
}
Idle.add((owned)callback); Idle.add((owned)callback);
return null; return null;
}); });

View file

@ -117,6 +117,7 @@ public static Gee.List<Key> get_keylist(string? pattern = null, bool secret_only
} catch (Error e) { } catch (Error e) {
if (e.code != GPGError.ErrorCode.EOF) throw e; if (e.code != GPGError.ErrorCode.EOF) throw e;
} }
context.op_keylist_end();
return keys; return keys;
} finally { } finally {
global_mutex.unlock(); global_mutex.unlock();

View file

@ -38,7 +38,7 @@ namespace GPG {
} }
[Compact] [Compact]
[CCode (cname = "struct _gpgme_key", ref_function = "gpgme_key_ref", ref_function_void = true, unref_function = "gpgme_key_unref", free_function = "gpgme_key_release")] [CCode (cname = "struct _gpgme_key", ref_function = "gpgme_key_ref_vapi", unref_function = "gpgme_key_unref_vapi", free_function = "gpgme_key_release")]
public class Key { public class Key {
public bool revoked; public bool revoked;
public bool expired; public bool expired;