Skip to content

Commit 8cb3a60

Browse files
authored
fix: release old options_object reference in set_options to fix memory leak on config reload
1 parent 703151b commit 8cb3a60

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

kitty/state.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,7 @@ PYWRAP1(set_options) {
938938
global_state.debug_rendering = debug_rendering ? true : false;
939939
global_state.debug_font_fallback = debug_font_fallback ? true : false;
940940
if (!convert_opts_from_python_opts(opts, &global_state.opts)) return NULL;
941+
Py_XDECREF(global_state.options_object);
941942
global_state.options_object = opts;
942943
Py_INCREF(global_state.options_object);
943944
Py_RETURN_NONE;

0 commit comments

Comments
 (0)