diff --git a/src/matfx.cpp b/src/matfx.cpp index 44806f9..3227d09 100644 --- a/src/matfx.cpp +++ b/src/matfx.cpp @@ -596,10 +596,11 @@ matfxOpen(void *o, int32, int32) static void* matfxClose(void *o, int32, int32) { + for(uint i = 0; i < nelem(matFXGlobals.pipelines); i++) + if(matFXGlobals.pipelines[i] == matFXGlobals.dummypipe) + matFXGlobals.pipelines[i] = nil; matFXGlobals.dummypipe->destroy(); matFXGlobals.dummypipe = nil; - for(uint i = 0; i < nelem(matFXGlobals.pipelines); i++) - matFXGlobals.pipelines[i] = nil; return o; } diff --git a/src/skin.cpp b/src/skin.cpp index dfccd83..3d7eac4 100644 --- a/src/skin.cpp +++ b/src/skin.cpp @@ -342,10 +342,11 @@ skinOpen(void *o, int32, int32) static void* skinClose(void *o, int32, int32) { + for(uint i = 0; i < nelem(skinGlobals.pipelines); i++) + if(skinGlobals.pipelines[i] == skinGlobals.dummypipe) + matFXGlobals.pipelines[i] = nil; skinGlobals.dummypipe->destroy(); skinGlobals.dummypipe = nil; - for(uint i = 0; i < nelem(skinGlobals.pipelines); i++) - skinGlobals.pipelines[i] = nil; return o; }