Репозиторий Sisyphus
Последнее обновление: 7 апреля 2020 | Пакетов: 17566 | Посещений: 17841548
en ru br
Репозитории ALT

Группа :: Звук
Пакет: kde5-kwave

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: KDEBUG-394358.patch
Скачать


From 870d8799ac80926f579a0b77cf37c534cb595369 Mon Sep 17 00:00:00 2001
From: Thomas Eschenbacher <Thomas.Eschenbacher@gmx.de>
Date: Sat, 1 Feb 2020 06:58:32 +0100
Subject: bugfix: cleanup code in destructor of PluginManager caused crash when
 closing the window due to broken iterator
---
 CHANGES                    | 4 +++-
 libkwave/PluginManager.cpp | 5 +++--
 2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/CHANGES b/CHANGES
index 9d4c242..063a6fb 100644
--- a/CHANGES
+++ b/CHANGES
@@ -9,10 +9,12 @@
  * changed SAMPLE_INDEX_MAX to maximum value of a 32bit int (2.147.483.647)
  * removed class MemoryManager, use Kwave::SampleArray directly as backend
    for Kwave::Stripe (which reduces complexity a lot)
+ * bugfix: cleanup code in destructor of PluginManager caused crash when
+   closing the window due to broken iterator
 
 19.07.70 [2019-03-16]
 
-* bugfix for KDE #394358 (Kwave crashes when closing About dialog)
+ * bugfix for KDE #394358 (Kwave crashes when closing About dialog)
  * bugfix: no longer use pa_write_start in PulseAudio playback (caused
    invalid internal memory reuse in PulseAudio server + assert)
  * bugfix for KDE #389159 (Recording Pause function does not work)
diff --git a/libkwave/PluginManager.cpp b/libkwave/PluginManager.cpp
index 29085d5..f3872ed 100644
--- a/libkwave/PluginManager.cpp
+++ b/libkwave/PluginManager.cpp
@@ -95,7 +95,7 @@ Kwave::PluginManager::~PluginManager()
 
     // release all loaded modules
     for (QMap<QString, PluginModule>::iterator it(m_plugin_modules.begin());
-         it != m_plugin_modules.end(); ++it)
+         it != m_plugin_modules.end(); )
     {
 	const QString &name = it.key();
 	PluginModule  &p    = it.value();
@@ -109,12 +109,13 @@ Kwave::PluginManager::~PluginManager()
             p.m_factory = Q_NULLPTR;
 
 	    // remove the module from the list
-	    m_plugin_modules.remove(name);
+	    it = m_plugin_modules.erase(it);
 
 	    // now the handle of the shared object can be released too
 	    if (factory) delete factory;
 	} else {
 	    // still in use
+	    ++it;
 	}
     }
 
-- 
cgit v1.1
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin