mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-22 14:09:10 +00:00
(svn r17230) -Fix (r15027): don't assert when an AI uses AI*Mode objects incorrectly but crash the AI instead
This commit is contained in:
12
src/3rdparty/squirrel/squirrel/sqclass.h
vendored
12
src/3rdparty/squirrel/squirrel/sqclass.h
vendored
@@ -128,7 +128,17 @@ public:
|
||||
}
|
||||
void Release() {
|
||||
_uiRef++;
|
||||
if (_hook) { _hook(_userpointer,0);}
|
||||
try {
|
||||
if (_hook) { _hook(_userpointer,0);}
|
||||
} catch (...) {
|
||||
_uiRef--;
|
||||
if (_uiRef == 0) {
|
||||
SQInteger size = _memsize;
|
||||
this->~SQInstance();
|
||||
SQ_FREE(this, size);
|
||||
}
|
||||
throw;
|
||||
}
|
||||
_uiRef--;
|
||||
if(_uiRef > 0) return;
|
||||
SQInteger size = _memsize;
|
||||
|
Reference in New Issue
Block a user