Fixed an issue where clementine could crash: A client connects before the playlist manager is
initialized. This caused a null pointer exception. Now the server is started after the playlist manager was initialized.
This commit is contained in:
parent
0828115c74
commit
78ad2fb517
src
@ -108,8 +108,11 @@ Application::Application(QObject* parent)
|
||||
network_remote_ = new NetworkRemote(this);
|
||||
MoveToNewThread(network_remote_);
|
||||
|
||||
// This must be before libraray_->Init();
|
||||
// In the constructor the helper waits for the signal PlaylistManagerInitialized
|
||||
// to start the remote. Without the playlist manager clementine can
|
||||
// crash when a client connects before the manager is initialized!
|
||||
network_remote_helper_ = new NetworkRemoteHelper(this);
|
||||
network_remote_helper_->StartServer();
|
||||
|
||||
library_->Init();
|
||||
|
||||
|
@ -33,6 +33,10 @@ NetworkRemoteHelper::NetworkRemoteHelper(Application* app)
|
||||
connect(this, SIGNAL(SetupServerSig()),
|
||||
app_->network_remote(), SLOT(SetupServer()));
|
||||
|
||||
// Start the server once the playlistmanager is initialized
|
||||
connect(app_->playlist_manager(), SIGNAL(PlaylistManagerInitialized()),
|
||||
this, SLOT(StartServer()));
|
||||
|
||||
sInstance = this;
|
||||
}
|
||||
|
||||
|
@ -13,9 +13,11 @@ public:
|
||||
NetworkRemoteHelper(Application* app);
|
||||
~NetworkRemoteHelper();
|
||||
|
||||
void StartServer();
|
||||
void ReloadSettings();
|
||||
|
||||
private slots:
|
||||
void StartServer();
|
||||
|
||||
signals:
|
||||
void SetupServerSig();
|
||||
void StartServerSig();
|
||||
|
Loading…
x
Reference in New Issue
Block a user