fix: some crashes

This commit is contained in:
Alex
2026-02-24 00:49:03 +01:00
parent a32413a74f
commit ef3d55980e
40 changed files with 216 additions and 103 deletions

View File

@ -48,7 +48,7 @@ class AModule : public IModule {
virtual bool handleMouseLeave(GdkEventCrossing* const& ev);
virtual bool handleScroll(GdkEventScroll*);
virtual bool handleRelease(GdkEventButton* const& ev);
GObject* menu_;
GObject* menu_ = nullptr;
private:
bool handleUserEvent(GdkEventButton* const& ev);

View File

@ -89,7 +89,7 @@ struct Sock {
}
};
class IPC {
class IPC : public std::enable_shared_from_this<IPC> {
static std::weak_ptr<IPC> instance;
Json::CharReaderBuilder reader_builder;
Json::StreamWriterBuilder writer_builder;
@ -98,7 +98,7 @@ class IPC {
State state;
std::mutex state_mutex;
IPC() { start(); }
IPC() = default;
static auto connect() -> Sock;
auto receive(Sock& sock) -> Json::Value;

View File

@ -59,6 +59,7 @@ inline int close(FILE* fp, pid_t pid) {
spdlog::debug("Cmd continued");
} else if (ret == -1) {
spdlog::debug("waitpid failed: {}", strerror(errno));
break;
} else {
break;
}