Skip to content

Commit

Permalink
Use deleteLater to destroy device backends
Browse files Browse the repository at this point in the history
  • Loading branch information
jbroadus authored and hatstand committed Jun 7, 2020
1 parent c299c19 commit cf8d200
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/devices/connecteddevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ ConnectedDevice::ConnectedDevice(const QUrl& url, DeviceLister* lister,
qLog(Info) << "connected" << url << unique_id << first_time;

// Create the backend in the database thread.
backend_.reset(new LibraryBackend(), [](QObject* obj) { delete obj; });
backend_.reset(new LibraryBackend(),
[](QObject* obj) { obj->deleteLater(); });
backend_->moveToThread(app_->database()->thread());

connect(backend_.get(), SIGNAL(TotalSongCountUpdated(int)),
Expand Down

0 comments on commit cf8d200

Please sign in to comment.