This is the offending line:
Texture *texture = new Texture (...);
I receive from bad_alloc here:
void *__CRTDECL operator new(size_t size) _THROW1(_STD bad_alloc)
{ // try to allocate size bytes
void *p;
while ((p = malloc(size)) == 0)
if (_callnewh(size) == 0)
{ // report no memory
static const std::bad_alloc nomem;
_RAISE(nomem);
}
return (p);
}
size is ~28 bytes big
and so far the program has placed maybe 2 MB on the heap in a 32bit system (fresh reboot) and before this only about twenty things get allocated on the heap so I know there's no heap corruption.
I'm so confused...
According to MSDN, _callnewh():
So you haven't correctly installed the 'new handler' using
_set_new_handler()
.