summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Grönholm <alex.gronholm@nextday.fi>2015-10-01 18:13:05 +0300
committerAlex Grönholm <alex.gronholm@nextday.fi>2015-10-01 18:18:27 +0300
commit9dae3bac24ff4830557a66bd0795762b8f9fa581 (patch)
tree6bce4e1dcc12a8ddd9b9561fb863631ea67b89ba
parentd98367d1df80f06e653cf2bafd5d4d92138fc861 (diff)
downloadapscheduler-9dae3bac24ff4830557a66bd0795762b8f9fa581.tar.gz
Fixed a memory leak in the base executor class (thanks Stefan Nordhausen)
-rw-r--r--apscheduler/executors/base.py4
-rw-r--r--docs/versionhistory.rst6
2 files changed, 10 insertions, 0 deletions
diff --git a/apscheduler/executors/base.py b/apscheduler/executors/base.py
index 5a0a19e..7f48b41 100644
--- a/apscheduler/executors/base.py
+++ b/apscheduler/executors/base.py
@@ -74,6 +74,8 @@ class BaseExecutor(six.with_metaclass(ABCMeta, object)):
with self._lock:
self._instances[job_id] -= 1
+ if self._instances[job_id] == 0:
+ del self._instances[job_id]
for event in events:
self._scheduler._dispatch_event(event)
@@ -83,6 +85,8 @@ class BaseExecutor(six.with_metaclass(ABCMeta, object)):
with self._lock:
self._instances[job_id] -= 1
+ if self._instances[job_id] == 0:
+ del self._instances[job_id]
exc_info = (exc.__class__, exc, traceback)
self._logger.error('Error running job %s', job_id, exc_info=exc_info)
diff --git a/docs/versionhistory.rst b/docs/versionhistory.rst
index b5158e5..450e442 100644
--- a/docs/versionhistory.rst
+++ b/docs/versionhistory.rst
@@ -5,6 +5,12 @@ To find out how to migrate your application from a previous version of
APScheduler, see the :doc:`migration section <migration>`.
+3.0.4
+-----
+
+* Fixed memory leak in the base executor class (contributed by Stefan Nordhausen)
+
+
3.0.3
-----