Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/core/generation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ void EngineGeneration::setWatchingFiles(bool watching) {
}
} else {
if (this->watcher != nullptr) {
QObject::disconnect(this->watcher, nullptr, this, nullptr);
this->watcher->deleteLater();
this->watcher = nullptr;
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/persistentprops.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "reload.hpp"

///! Object that holds properties that can persist across a config reload.
/// PersistentProperties holds properties declated in it across a reload, which is
/// PersistentProperties holds properties declared in it across a reload, which is
/// often useful for things like keeping expandable popups open and styling them.
///
/// Below is an example of using `PersistentProperties` to keep track of the state
Expand Down
8 changes: 7 additions & 1 deletion src/core/qsmenuanchor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ void QsMenuAnchor::onClosed() {
this->mOpen = false;

if (this->platformMenu) {
QObject::disconnect(this->platformMenu, nullptr, this, nullptr);
this->platformMenu->deleteLater();
this->platformMenu = nullptr;
}
Expand Down Expand Up @@ -101,7 +102,12 @@ void QsMenuAnchor::setMenu(QsMenuHandle* menu) {
if (menu == this->mMenu) return;

if (this->mMenu != nullptr) {
if (this->platformMenu != nullptr) this->platformMenu->deleteLater();
if (this->platformMenu != nullptr) {
QObject::disconnect(this->platformMenu, nullptr, this, nullptr);
this->platformMenu->deleteLater();
this->platformMenu = nullptr;
}

QObject::disconnect(this->mMenu, nullptr, this, nullptr);
}

Expand Down
2 changes: 2 additions & 0 deletions src/io/process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ void Process::onStarted() {
}

void Process::onFinished(qint32 exitCode, QProcess::ExitStatus exitStatus) {
QObject::disconnect(this->process, nullptr, this, nullptr);
this->process->deleteLater();
this->process = nullptr;
if (this->mStdoutParser) this->mStdoutParser->streamEnded(this->stdoutBuffer);
Expand All @@ -290,6 +291,7 @@ void Process::onErrorOccurred(QProcess::ProcessError error) {
if (error == QProcess::FailedToStart) { // other cases should be covered by other events
qWarning() << "Process failed to start, likely because the binary could not be found. Command:"
<< this->mCommand;
QObject::disconnect(this->process, nullptr, this, nullptr);
this->process->deleteLater();
this->process = nullptr;
emit this->runningChanged();
Expand Down
8 changes: 7 additions & 1 deletion src/io/socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
QS_LOGGING_CATEGORY(logSocket, "quickshell.io.socket", QtWarningMsg);

void Socket::setSocket(QLocalSocket* socket) {
if (this->socket != nullptr) this->socket->deleteLater();
if (this->socket != nullptr) {
QObject::disconnect(this->socket, nullptr, this, nullptr);
this->socket->deleteLater();
}

this->socket = socket;

if (socket != nullptr) {
Expand Down Expand Up @@ -57,6 +61,7 @@ void Socket::onSocketDisconnected() {
qCDebug(logSocket) << "Socket disconnected:" << this;
this->connected = false;
this->disconnecting = false;
QObject::disconnect(this->socket, nullptr, this, nullptr);
this->socket->deleteLater();
this->socket = nullptr;
this->buffer.clear();
Expand Down Expand Up @@ -191,6 +196,7 @@ void SocketServer::disableServer() {
}

this->mSockets.clear();
QObject::disconnect(this->server, nullptr, this, nullptr);
this->server->close();
this->server->deleteLater();
this->server = nullptr;
Expand Down
1 change: 1 addition & 0 deletions src/ipc/ipc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ IpcServerConnection::IpcServerConnection(QLocalSocket* socket, IpcServer* server

void IpcServerConnection::onDisconnected() {
qCInfo(logIpc) << "IPC connection disconnected" << this;
QObject::disconnect(this->socket, nullptr, this, nullptr);
this->deleteLater();
}

Expand Down
4 changes: 3 additions & 1 deletion src/services/mpris/watcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ void MprisWatcher::onServiceRegistered(const QString& service) {

void MprisWatcher::onServiceUnregistered(const QString& service) {
if (auto* player = this->mPlayers.value(service)) {
player->deleteLater();
QObject::disconnect(player, nullptr, this, nullptr);
this->mPlayers.remove(service);
this->readyPlayers.removeObject(player);
player->deleteLater();
qCDebug(logMprisWatcher) << "Unregistered MprisPlayer" << service;
} else {
qCWarning(logMprisWatcher) << "Got service unregister event for untracked service" << service;
Expand Down
1 change: 1 addition & 0 deletions src/services/pipewire/connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ void PwConnection::startSocketWatcher() {
void PwConnection::stopSocketWatcher() {
if (this->socketWatcher == nullptr) return;

QObject::disconnect(this->socketWatcher, nullptr, this, nullptr);
this->socketWatcher->deleteLater();
this->socketWatcher = nullptr;
}
Expand Down
6 changes: 4 additions & 2 deletions src/services/polkit/agentimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ void PolkitAgentImpl::cancelAllRequests(const QString& reason) {

auto* flow = this->bActiveFlow.value();
if (flow) {
QObject::disconnect(flow, nullptr, this, nullptr);
this->bActiveFlow = nullptr;
flow->cancelAuthenticationRequest();
flow->deleteLater();
}
Expand Down Expand Up @@ -169,12 +171,12 @@ void PolkitAgentImpl::finishAuthenticationRequest() {
qCDebug(logPolkit) << "finishing authentication request for action"
<< this->bActiveFlow.value()->actionId();

QObject::disconnect(this->bActiveFlow.value(), nullptr, this, nullptr);
this->bActiveFlow.value()->deleteLater();
this->bActiveFlow = nullptr;

if (!this->queuedRequests.empty()) {
this->activateAuthenticationRequest();
} else {
this->bActiveFlow = nullptr;
}
}
} // namespace qs::service::polkit
3 changes: 2 additions & 1 deletion src/wayland/hyprland/ipc/connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,9 @@ void HyprlandIpc::makeRequest(
requestSocket->flush();
};

auto errorCallback = [=](QLocalSocket::LocalSocketError error) {
auto errorCallback = [=, this](QLocalSocket::LocalSocketError error) {
qCWarning(logHyprlandIpc) << "Error making request:" << error << "request:" << request;
QObject::disconnect(requestSocket, nullptr, this, nullptr);
requestSocket->deleteLater();
callback(false, {});
};
Expand Down
Loading