mirror of
https://github.com/chatmail/core.git
synced 2026-05-03 21:36:29 +03:00
python: do not pass NULL to ffi.gc if the context can't be created
This commit is contained in:
@@ -27,6 +27,7 @@
|
|||||||
- Assume all Thunderbird users prefer encryption #3774
|
- Assume all Thunderbird users prefer encryption #3774
|
||||||
- refactor peerstate handling to ensure no duplicate peerstates #3776
|
- refactor peerstate handling to ensure no duplicate peerstates #3776
|
||||||
- Fetch messages in order of their INTERNALDATE (fixes reactions for Gmail f.e.) #3789
|
- Fetch messages in order of their INTERNALDATE (fixes reactions for Gmail f.e.) #3789
|
||||||
|
- python: do not pass NULL to ffi.gc if the context can't be created #3818
|
||||||
|
|
||||||
|
|
||||||
## 1.102.0
|
## 1.102.0
|
||||||
|
|||||||
@@ -82,12 +82,13 @@ class Account(object):
|
|||||||
if hasattr(db_path, "encode"):
|
if hasattr(db_path, "encode"):
|
||||||
db_path = db_path.encode("utf8")
|
db_path = db_path.encode("utf8")
|
||||||
|
|
||||||
self._dc_context = ffi.gc(
|
ptr = lib.dc_context_new_closed(db_path) if closed else lib.dc_context_new(ffi.NULL, db_path, ffi.NULL)
|
||||||
lib.dc_context_new_closed(db_path) if closed else lib.dc_context_new(ffi.NULL, db_path, ffi.NULL),
|
|
||||||
lib.dc_context_unref,
|
|
||||||
)
|
|
||||||
if self._dc_context == ffi.NULL:
|
if self._dc_context == ffi.NULL:
|
||||||
raise ValueError("Could not dc_context_new: {} {}".format(os_name, db_path))
|
raise ValueError("Could not dc_context_new: {} {}".format(os_name, db_path))
|
||||||
|
self._dc_context = ffi.gc(
|
||||||
|
ptr,
|
||||||
|
lib.dc_context_unref,
|
||||||
|
)
|
||||||
|
|
||||||
self._shutdown_event = Event()
|
self._shutdown_event = Event()
|
||||||
self._event_thread = EventThread(self)
|
self._event_thread = EventThread(self)
|
||||||
|
|||||||
Reference in New Issue
Block a user