How to catch extern Memory Exception?

BlitzMax Forums/BlitzMax Programming/How to catch extern Memory Exception?

Difference(Posted 2009) [#1]
Hi.

Is there a way to catch extern "Unhandled Memory Exception Error"

in my case a few models is crashin assimp on
Extern 
	Function aiImportFile:Int Ptr( pFile$z,pFlags:Int)
End Extern

Local pointer:Int ptr = aiImportFile(filename ,readflags)



Brucey(Posted 2009) [#2]
If it is C++ and the library throws an exception, you can wrap it with some proper glue and either handle it yourself in some way or throw a BlitzMax exception.


Difference(Posted 2009) [#3]
Thanks Brucey, but I'm using the plain C interface of the lib, and I don't want to make C or C++ code, only BlitzMax code.

The lib obviously needs some fixing so it doesn't crash, but until then, I'm looking for a solution. It seems it's only one model format that makes it crash, so I'll disallow that for now.

But maybe I could call the extern in a thread and have only that crash...