[Qt-interest] QScriptEngine: "Could not allocate register file: 12"

Bob Hood bhood2 at comcast.net
Thu May 6 20:33:33 CEST 2010


On 5/6/2010 12:16 PM, Pedro Santos wrote:
> Am 06.05.2010 10:33, schrieb Thiago Macieira:
>
>> #else
>>              fprintf(stderr, "Could not allocate register file: %d\n", errno);
>> #endif
>>              CRASH();
>>          }
>>
>> And as someone suspected, 12 is the errno and on Linux:
>>
>> #define ENOMEM          12      /* Out of memory */
>
> Is there a way to avoid the crash of the application? I've tryed to surround 
> the allocation of QScriptEngine's with a try/catch block, but it won't work. I 
> have no experience catching exections in C++, so I don't know if its possible 
> in this case and when yes, what I do wrong.

If it's an actual C++ exception, then you should be able to catch it
simply by:

    try {
        <code that generates an exception>
    }
    catch(...) {
        <process a generic exception>
    }




More information about the Qt-interest-old mailing list