diff options
Diffstat (limited to 'src/memory.cc')
-rw-r--r-- | src/memory.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/memory.cc b/src/memory.cc index 8e5574a..f8719e7 100644 --- a/src/memory.cc +++ b/src/memory.cc @@ -29,7 +29,11 @@ void * operator new(size_t size) { void * mem = malloc(size); while(mem == NULL) { - new_handl(); + if(new_handl != NULL) { + new_handl(); + } else { + throw std::bad_alloc(); + } mem = malloc(size); } |