Skip to content

Commit

Permalink
fix possible crash
Browse files Browse the repository at this point in the history
  • Loading branch information
scheffle committed Feb 21, 2024
1 parent 6dc1b41 commit fdce049
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions vstgui/uidescription-scripting/detail/drawcontextobject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,13 @@ DrawContextObject::DrawContextObject ()
#endif
}

//------------------------------------------------------------------------
DrawContextObject::~DrawContextObject () noexcept
{
if (scriptVar)
scriptVar->setLifeTimeObserver (nullptr);
}

//------------------------------------------------------------------------
void DrawContextObject::setDrawContext (CDrawContext* inContext, IUIDescription* inUIDesc)
{
Expand Down
1 change: 1 addition & 0 deletions vstgui/uidescription-scripting/detail/drawcontextobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ struct DrawContextObject : ScriptObject,
TJS::IScriptVarLifeTimeObserver
{
DrawContextObject ();
~DrawContextObject () noexcept override;

void setDrawContext (CDrawContext* context, IUIDescription* uiDesc);

Expand Down

0 comments on commit fdce049

Please sign in to comment.