diff options
| author | Dan Engelbrecht <[email protected]> | 2023-05-24 15:15:02 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-05-24 15:15:02 +0200 |
| commit | c69b7341838f86f73519e20b83996b609cda7f6c (patch) | |
| tree | 394a00b17814c943059513f4781065c236753d3b /src/zencore | |
| parent | cache log sessionid (#297) (diff) | |
| download | zen-c69b7341838f86f73519e20b83996b609cda7f6c.tar.xz zen-c69b7341838f86f73519e20b83996b609cda7f6c.zip | |
block destructors from throwing exceptions (#321)
* ~FileMapping() is not allowed to throw exceptions
* ~ScopedActivityBase() should not call ZEN_ASSERT (which causes SIGABORT on error)
* ProjectStore::Project::WriteAccessTimes() which is called from ProjectStore::~Project() must not throw exceptions
* changelog
Diffstat (limited to 'src/zencore')
| -rw-r--r-- | src/zencore/include/zencore/windows.h | 4 | ||||
| -rw-r--r-- | src/zencore/logging.cpp | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/zencore/include/zencore/windows.h b/src/zencore/include/zencore/windows.h index 333188cb3..6c238f845 100644 --- a/src/zencore/include/zencore/windows.h +++ b/src/zencore/include/zencore/windows.h @@ -252,7 +252,7 @@ public: m_hMapping = NULL; } - ~FileMapping() throw() { Unmap(); } + ~FileMapping() noexcept(true) { Unmap(); } HRESULT MapFile(_In_ HANDLE hFile, _In_ SIZE_T nMappingSize = 0, @@ -372,7 +372,7 @@ public: return S_OK; } - HRESULT Unmap() throw() + HRESULT Unmap() noexcept(true) { HRESULT hr = S_OK; diff --git a/src/zencore/logging.cpp b/src/zencore/logging.cpp index 07b379cba..dc923f45e 100644 --- a/src/zencore/logging.cpp +++ b/src/zencore/logging.cpp @@ -131,7 +131,11 @@ ScopedActivityBase::ScopedActivityBase() : m_NextScope{t_ScopeStack} ScopedActivityBase::~ScopedActivityBase() { - ZEN_ASSERT(t_ScopeStack == this); + if (t_ScopeStack != this) + { + ZEN_ERROR("invalid t_ScopeStack in ~ScopedActivityBase(). Expected {:#x}, found {:#x}", (uintptr_t)this, (uintptr_t)t_ScopeStack); + return; + } t_ScopeStack = m_NextScope; } |