Fix bug in which ObjectFixture gets called at exit after raylib gets set to None. (#416)

This commit is contained in:
Robert Nishihara
2016-09-07 18:49:19 -07:00
committed by Philipp Moritz
parent d264713ceb
commit 5802cab87c
+5 -1
View File
@@ -272,7 +272,11 @@ class ObjectFixture(object):
def __del__(self):
"""Unmap the segment when the object goes out of scope."""
raylib.unmap_object(self.handle, self.segmentid)
# We probably shouldn't have this if statement, but if raylib gets set to
# None before this __del__ call happens, then an exception will be thrown
# at exit.
if raylib is not None:
raylib.unmap_object(self.handle, self.segmentid)
class Worker(object):
"""A class used to define the control flow of a worker process.