Skip to content

Commit b57b7b2

Browse files
author
Felix Igelbrink
committed
proper module destruction
1 parent 5d1841c commit b57b7b2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

optix/module.pyx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ from .pipeline cimport PipelineCompileOptions
99
from .pipeline import CompileDebugLevel
1010
from .build import PrimitiveType, BuildFlags, CurveEndcapFlags
1111
from .common import ensure_iterable
12+
from libc.stdint cimport uintptr_t
1213

1314
optix_init()
1415

@@ -202,7 +203,8 @@ cdef class Module(OptixContextObject):
202203
&self.module))
203204

204205
def __dealloc__(self):
205-
optix_check_return(optixModuleDestroy(self.module))
206+
if <uintptr_t> self.module != 0:
207+
optix_check_return(optixModuleDestroy(self.module))
206208

207209
@classmethod
208210
def builtin_is_module(cls,

0 commit comments

Comments
 (0)