[pulseaudio-commits] src/pavuapplication.cc src/pavuapplication.h
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Sun Oct 21 09:01:25 UTC 2018
src/pavuapplication.cc | 9 ++++++++-
src/pavuapplication.h | 2 +-
2 files changed, 9 insertions(+), 2 deletions(-)
New commits:
commit d3b3bee3787523df31a885febb16da582d60f1aa
Author: Tanu Kaskinen <tanuk at iki.fi>
Date: Thu Oct 18 15:27:10 2018 +0300
pavuapplication: initialize members in the constructor
It seems that without explicit initialization of the members they remain
uninitialized. The lack of initialization caused crashing, because
PavuApplication::on_activate() creates the MainWindow only if mainWindow
is NULL, and if it's some random value instead, on_activate() calls
selectTab() on a non-existent window.
Fixes: https://gitlab.freedesktop.org/pulseaudio/pavucontrol/issues/49
diff --git a/src/pavuapplication.cc b/src/pavuapplication.cc
index c8e5edd..e8520ec 100644
--- a/src/pavuapplication.cc
+++ b/src/pavuapplication.cc
@@ -30,7 +30,14 @@
#include "pavucontrol.h"
#include "mainwindow.h"
-PavuApplication::PavuApplication() : Gtk::Application("org.pulseaudio.pavucontrol", Gio::ApplicationFlags::APPLICATION_HANDLES_COMMAND_LINE) {
+PavuApplication::PavuApplication() :
+ Gtk::Application("org.pulseaudio.pavucontrol", Gio::ApplicationFlags::APPLICATION_HANDLES_COMMAND_LINE),
+ mainWindow(NULL),
+ retry(false),
+ maximize(false),
+ tab(0),
+ version(false),
+ m(NULL) {
}
/*
diff --git a/src/pavuapplication.h b/src/pavuapplication.h
index 4df722f..3589c5d 100644
--- a/src/pavuapplication.h
+++ b/src/pavuapplication.h
@@ -45,7 +45,7 @@ private:
MainWindow* create_window();
void on_hide_window(Gtk::Window* window);
- pa_glib_mainloop *m = NULL;
+ pa_glib_mainloop *m;
};
More information about the pulseaudio-commits
mailing list