From 0464e9f864da7b71fdf7b568916596fbb8a614bb Mon Sep 17 00:00:00 2001 From: rubidium Date: Fri, 9 Jan 2009 15:01:15 +0000 Subject: (svn r14935) -Fix [FS#2498]: the new operator may not return NULL, so don't. --- src/oldpool_func.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/oldpool_func.h') diff --git a/src/oldpool_func.h b/src/oldpool_func.h index 3fbed16a7..82b451617 100644 --- a/src/oldpool_func.h +++ b/src/oldpool_func.h @@ -11,7 +11,8 @@ * Allocate a pool item; possibly allocate a new block in the pool. * @param first the first pool item to start searching * @pre first <= Tpool->GetSize() - * @return the allocated pool item (or NULL when the pool is full). + * @pre CanAllocateItem() + * @return the allocated pool item */ template *Tpool> T *PoolItem::AllocateSafeRaw(uint &first) { @@ -31,7 +32,8 @@ template *Tpool> T *PoolItemAddBlockToPool()) return AllocateRaw(first); - return NULL; + /* One should *ALWAYS* be sure to have enough space before making vehicles! */ + NOT_REACHED(); } /** -- cgit v1.2.3-70-g09d2