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
UnhandledExceptionHandleris ignored when this error is thrown. App Bcrashes due to a bug in QtWebkit which could feasibly be handled byApp Bvia deleting the oversize object and returning null.App Adoes 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 Bfor whatever reason.