Skip to content

Commit 7808e0b

Browse files
Lv2 Fix invalid memory access if plugin did not load
1 parent 5d0340f commit 7808e0b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/core/lv2/Lv2Proc.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,9 +396,12 @@ void Lv2Proc::initPlugin()
396396

397397
void Lv2Proc::shutdownPlugin()
398398
{
399-
lilv_instance_deactivate(m_instance);
400-
lilv_instance_free(m_instance);
401-
m_instance = nullptr;
399+
if (m_valid)
400+
{
401+
lilv_instance_deactivate(m_instance);
402+
lilv_instance_free(m_instance);
403+
m_instance = nullptr;
404+
}
402405
}
403406

404407

0 commit comments

Comments
 (0)