An exception is thrown in lock_fhandle where retval = 0.
Why is this?
It happens in the source file of "InputFileHandler" when it calls the function "AllocateInputState" of the class "VInput", but only when I run this particular function a second time, even if on a different VInput object, but with the same FileHandler.
If I delete the FileHandler and use a new one, this doesn't happen.
How can I fix it without having to use a new FileHandler object every time?
What operating system are you using?
What compiler are you using?
What library are you using?
Have you tried debugging?
Have you tried exception handling?
There's a lot of important information you've left out.
If a C runtime function will not throw a C++ exception.
If you are seeing an exception, then it's probably an WIN32 Structured Exception (exception supported by the OS). If that's the case, you can find out what kind of SE it is. My bet would be a NULL pointer violation.
If you're getting all these wierd execptions (of whatever type), I'd say that you've corrupted the heap earlier and the error is not at the point where the exceptions are thrown.