mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 00:06:44 -04:00
task: work around MSVC compiler bug crashing test suite in release mode
This commit is contained in:
parent
93ed9632ac
commit
aea5ee8c7a
@ -30,6 +30,20 @@ AsyncFuture::
|
||||
// If this triggers, the future destroyed before it was cancelled, which is
|
||||
// not valid. Unless we should simply call cancel() here?
|
||||
nassertv(_waiting.empty());
|
||||
|
||||
// This is an attempt to work around what appears to be a compiler bug in
|
||||
// MSVC when compiling with optimizations and having an EventStoreInt stored
|
||||
// in this field. It crashes when we delete via the ReferenceCount base
|
||||
// instead of via the TypedObject. I haven't been able to find out why;
|
||||
// just that it doesn't happen with ParamString. ~rdb
|
||||
ReferenceCount *result_ref = _result_ref.p();
|
||||
if (result_ref != nullptr) {
|
||||
_result_ref.cheat() = nullptr;
|
||||
if (!result_ref->unref()) {
|
||||
delete _result;
|
||||
}
|
||||
_result = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user