Skip to content

Commit

Permalink
Fix new static analysis issues related to exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
egorodet committed Aug 13, 2022
1 parent ace6daa commit 895f711
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Modules/Graphics/App/Include/Methane/Graphics/AppBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class AppBase // NOSONAR
RenderPattern& GetScreenRenderPattern() const { META_CHECK_ARG_NOT_NULL(m_screen_render_pattern_ptr); return *m_screen_render_pattern_ptr; }
const Ptr<ViewState>& GetViewStatePtr() const noexcept { return m_view_state_ptr; }
ViewState& GetViewState() { META_CHECK_ARG_NOT_NULL(m_view_state_ptr); return *m_view_state_ptr; }
FrameSize GetFrameSizeInDots() const noexcept { return m_context_ptr->GetSettings().frame_size / m_context_ptr->GetContentScalingFactor(); }
FrameSize GetFrameSizeInDots() const { return m_context_ptr->GetSettings().frame_size / m_context_ptr->GetContentScalingFactor(); }
ImageLoader& GetImageLoader() noexcept { return m_image_loader; }
Data::AnimationsPool& GetAnimations() noexcept { return m_animations; }
const Ptr<Texture>& GetDepthTexturePtr() const noexcept { return m_depth_texture_ptr; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ static D3D12_TEXTURE_ADDRESS_MODE ConvertAddressModeToDX(Sampler::Address::Mode
}
}

static void SetColor(const Color4F& in_color, FLOAT* p_out_color) noexcept
static void SetColor(const Color4F& in_color, FLOAT* p_out_color)
{
META_FUNCTION_TASK();
for (Data::Size i = 0; i < Color4F::Size; ++i)
Expand Down
11 changes: 10 additions & 1 deletion Modules/Graphics/Core/Sources/Methane/Graphics/QueryBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,16 @@ Query::Query(QueryBuffer& buffer, CommandListBase& command_list, Data::Index ind
Query::~Query()
{
META_FUNCTION_TASK();
m_buffer_ptr->ReleaseQuery(*this);
try
{
m_buffer_ptr->ReleaseQuery(*this);
}
catch(const std::exception& e)
{
META_UNUSED(e);
META_LOG("WARNING: Unexpected error during Query destruction: {}", e.what());
assert(false);
}
}

void Query::Begin()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,16 @@ RenderContextVK::RenderContextVK(const Platform::AppEnvironment& app_env, Device
RenderContextVK::~RenderContextVK()
{
META_FUNCTION_TASK();
RenderContextVK::Release();
try
{
RenderContextVK::Release();
}
catch(const std::exception& e)
{
META_UNUSED(e);
META_LOG("WARNING: Unexpected error during Query destruction: {}", e.what());
assert(false);
}
}

void RenderContextVK::Release()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class Context
const FrameSize& GetFrameSize() const noexcept { return GetRenderContext().GetSettings().frame_size; }

template<Units units>
[[nodiscard]] UnitSize GetFrameSizeIn() const noexcept
[[nodiscard]] UnitSize GetFrameSizeIn() const
{
META_FUNCTION_TASK();
if constexpr (units == Units::Pixels)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,16 @@ Font::Font(const Data::Provider& data_provider, const Settings& settings)
Font::~Font()
{
META_FUNCTION_TASK();
ClearAtlasTextures();
try
{
ClearAtlasTextures();
}
catch(const std::exception& e)
{
META_UNUSED(e);
META_LOG("WARNING: Unexpected error during Font destruction: {}", e.what());
assert(false);
}
}

void Font::ResetChars(const std::string& utf8_characters)
Expand Down

0 comments on commit 895f711

Please sign in to comment.