mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-08 14:18:26 +02:00
Fix a crash on exit on macOS
Calling Python API functions is not allowed in atexit handlers. Fixes #3686
This commit is contained in:
@@ -76,6 +76,8 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
|||||||
- Fix a regression that caused using the ``title`` command in session files
|
- Fix a regression that caused using the ``title`` command in session files
|
||||||
to stop working (:iss:`3676`)
|
to stop working (:iss:`3676`)
|
||||||
|
|
||||||
|
- macOS: Fix a rare crash on exit (:iss:`3686`)
|
||||||
|
|
||||||
|
|
||||||
0.20.3 [2021-05-06]
|
0.20.3 [2021-05-06]
|
||||||
----------------------
|
----------------------
|
||||||
|
|||||||
@@ -160,9 +160,11 @@ static PyObject *notification_activated_callback = NULL;
|
|||||||
|
|
||||||
static PyObject*
|
static PyObject*
|
||||||
set_notification_activated_callback(PyObject *self UNUSED, PyObject *callback) {
|
set_notification_activated_callback(PyObject *self UNUSED, PyObject *callback) {
|
||||||
if (notification_activated_callback) Py_DECREF(notification_activated_callback);
|
Py_CLEAR(notification_activated_callback);
|
||||||
|
if (callback != Py_None)
|
||||||
notification_activated_callback = callback;
|
notification_activated_callback = callback;
|
||||||
Py_INCREF(callback);
|
Py_INCREF(callback);
|
||||||
|
}
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -638,7 +640,6 @@ cleanup() {
|
|||||||
|
|
||||||
if (dockMenu) [dockMenu release];
|
if (dockMenu) [dockMenu release];
|
||||||
dockMenu = nil;
|
dockMenu = nil;
|
||||||
Py_CLEAR(notification_activated_callback);
|
|
||||||
|
|
||||||
#ifndef KITTY_USE_DEPRECATED_MACOS_NOTIFICATION_API
|
#ifndef KITTY_USE_DEPRECATED_MACOS_NOTIFICATION_API
|
||||||
drain_pending_notifications(NO);
|
drain_pending_notifications(NO);
|
||||||
|
|||||||
@@ -1182,3 +1182,7 @@ def click_mouse_url(os_window_id: int, tab_id: int, window_id: int) -> None:
|
|||||||
|
|
||||||
def mouse_selection(os_window_id: int, tab_id: int, window_id: int, code: int, button: int) -> None:
|
def mouse_selection(os_window_id: int, tab_id: int, window_id: int, code: int, button: int) -> None:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def set_notification_activated_callback(cb: Optional[Callable]) -> None:
|
||||||
|
pass
|
||||||
|
|||||||
@@ -178,6 +178,9 @@ class AppRunner:
|
|||||||
finally:
|
finally:
|
||||||
set_options(None)
|
set_options(None)
|
||||||
free_font_data() # must free font data before glfw/freetype/fontconfig/opengl etc are finalized
|
free_font_data() # must free font data before glfw/freetype/fontconfig/opengl etc are finalized
|
||||||
|
if is_macos:
|
||||||
|
from kitty.fast_data_types import set_notification_activated_callback
|
||||||
|
set_notification_activated_callback(None)
|
||||||
|
|
||||||
|
|
||||||
run_app = AppRunner()
|
run_app = AppRunner()
|
||||||
|
|||||||
Reference in New Issue
Block a user