I have a C# application App A
that calls, via P/Invoke, a C++ (Qt) DLL App B
. Let's assume I cannot, by any means, edit App B
, but I know that App B
is throwing an Out of Memory Exception
under a set of conditions which I can replicate but not accurately test for before passing input from App A
to App B
. This exception does not pose any threat to App A
and could be ignored if App B
could be "reset" in some manner, but when App B
crashes it calls abort()
which in turn causes App A
's runtime to terminate.
How can I prevent App B
's inevitable, unpredictable, and generally mundane crash from impacting App A
?
Notes:
- An implemented
UnhandledExceptionHandler
is ignored when this error is thrown. App B
crashes due to a bug in QtWebkit which could feasibly be handled byApp B
via deleting the oversize object and returning null.App A
does not report as out of memory and the machine has more than enough memory to perform theApp B
's operation several times over, regardless of the bug, but this memory is apparently not allocated toApp B
for whatever reason.