Skip to content

Commit fbd8e57

Browse files
committed
Fixed use after free for several scenarios when destroying the display
1 parent ea2e6bf commit fbd8e57

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

CHANGELOG

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*******************************************************************************
44

55
=== 1.0.30 ===
6-
6+
* Fixed use after free for several scenarios when destroying the display.
77

88
=== 1.0.29 ===
99
* Added text clipping function for tk::Label.

include/lsp-plug.in/tk/style/Schema.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ namespace lsp
136136
Schema(Schema &&) = delete;
137137
virtual ~Schema();
138138

139+
void destroy();
140+
139141
Schema & operator = (const Schema &) = delete;
140142
Schema & operator = (Schema &&) = delete;
141143

src/main/style/Schema.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ namespace lsp
6060
}
6161

6262
Schema::~Schema()
63+
{
64+
destroy();
65+
}
66+
67+
void Schema::destroy()
6368
{
6469
// Manually unbind all properties before destroying context
6570
sScaling.unbind();

src/main/sys/Display.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ namespace lsp
8181
sSlots.execute(SLOT_DESTROY, NULL);
8282
sSlots.destroy();
8383

84+
// Destroy schema
85+
sSchema.destroy();
86+
8487
// Destroy display
8588
if (pDisplay != NULL)
8689
{

0 commit comments

Comments
 (0)