Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Diff of /libkwave/KwaveFilterPlugin.cpp [5ae88a] .. [6f8185] Maximize Restore

  Switch to side-by-side view

--- a/libkwave/KwaveFilterPlugin.cpp
+++ b/libkwave/KwaveFilterPlugin.cpp
@@ -109,7 +109,7 @@
     if (!interpreteParameters(params)) m_params = params;
 
     MultiTrackReader source;
-    MultiTrackWriter sink;
+    MultiTrackWriter *sink = 0;
 
     selection(&first, &last, true);
     manager().openMultiTrackReader(source, selectedTracks(), first, last);
@@ -134,9 +134,14 @@
 	    close();
 	    return;
 	}
-	manager().openMultiTrackWriter(sink, selectedTracks(), Overwrite,
-	    first, last);
-	arts_sink = new ArtsMultiTrackSink(sink);
+	sink = new MultiTrackWriter(signalManager(), selectedTracks(),
+	    Overwrite, first, last);
+	Q_ASSERT(sink);
+	if (!sink) {
+	    close();
+	    return;
+	}
+	arts_sink = new ArtsMultiTrackSink(*sink);
     }
 
     Q_ASSERT(arts_sink);
@@ -144,6 +149,7 @@
 	if (filter)     delete filter;
 	if (arts_sink)  delete arts_sink;
 	if (undo_guard) delete undo_guard;
+	if (sink)       delete sink;
 	if (!m_listen) close();
 	return;
     }
@@ -223,6 +229,7 @@
     // cleanup
     delete arts_sink;
     if (undo_guard) delete undo_guard;
+    if (sink)       delete sink;
 
     m_pause  = false;
     m_stop   = false;