From eccfce4606aa1d6a9ea6ecf3799cb821d03344bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Derzsi=20D=C3=A1niel?= Date: Thu, 27 Feb 2020 15:09:28 +0200 Subject: [PATCH] task: Fix memory leak related to Python 3 signal API changes Python 3's signal.py API does not properly support custom signal handlers. An exception is created every frame because of this, which fills up the memory of the application. Closes #873 --- direct/src/task/Task.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/direct/src/task/Task.py b/direct/src/task/Task.py index e67f191d83..93e30eb3db 100644 --- a/direct/src/task/Task.py +++ b/direct/src/task/Task.py @@ -17,9 +17,13 @@ from direct.showbase.MessengerGlobal import messenger import types import random import importlib +import sys try: - import signal + if sys.version_info >= (3, 0): + import _signal as signal + else: + import signal except ImportError: signal = None