mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
abort when malloc fails
This commit is contained in:
parent
8a86a45e19
commit
bfb9453f37
@ -22,7 +22,12 @@
|
||||
#ifndef NDEBUG
|
||||
|
||||
void *default_operator_new(size_t size) {
|
||||
return malloc(size);
|
||||
void *ptr = malloc(size);
|
||||
if (ptr == (void *)NULL) {
|
||||
cerr << "Out of memory!\n";
|
||||
abort();
|
||||
}
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void default_operator_delete(void *ptr) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user