Browse Source

Fix memory leak when opening and closing remux window without remuxing

The remuxer thread was only started if there was an actual remux job,
which resulted in the remuxer thread not being able to call the worker's
destructor (because it wasn't running)
Palana 11 years ago
parent
commit
3dc1b7f3d5
1 changed files with 1 additions and 2 deletions
  1. 1 2
      obs/window-remux.cpp

+ 1 - 2
obs/window-remux.cpp

@@ -58,6 +58,7 @@ OBSRemux::OBSRemux(const char *path, QWidget *parent)
 			this, &OBSRemux::inputChanged);
 
 	worker->moveToThread(&remuxer);
+	remuxer.start();
 
 	//gcc-4.8 can't use QPointer<RemuxWorker> below
 	RemuxWorker *worker_ = worker;
@@ -157,8 +158,6 @@ void OBSRemux::Remux()
 	ui->progressBar->setVisible(true);
 	ui->remux->setEnabled(false);
 
-	if (!remuxer.isRunning())
-		remuxer.start();
 	emit remux();
 }