diff options
-rw-r--r-- | entityx/Entity.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/entityx/Entity.h b/entityx/Entity.h index e30f87e..c56b37d 100644 --- a/entityx/Entity.h +++ b/entityx/Entity.h @@ -220,8 +220,21 @@ struct BaseComponent { // NOTE: Component memory is *always* managed by the EntityManager. // Use Entity::destroy() instead. - void operator delete(void *p) { throw std::bad_alloc(); } - void operator delete[](void *p) { throw std::bad_alloc(); } + void operator delete(void *p) { +#ifdef _HAS_EXCEPTIONS + throw std::bad_alloc(); +#else + abort(); +#endif + } + + void operator delete[](void *p) { +#ifdef _HAS_EXCEPTIONS + throw std::bad_alloc(); +#else + abort(); +#endif + } protected: |