feat: Add crash recovery on Windows (#5012)
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
#pragma once
|
||||
|
||||
#include "common/Singleton.hpp"
|
||||
|
||||
#include <QtGlobal>
|
||||
|
||||
#ifdef CHATTERINO_WITH_CRASHPAD
|
||||
# include <client/crashpad_client.h>
|
||||
|
||||
# include <memory>
|
||||
#endif
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
class CrashHandler : public Singleton
|
||||
{
|
||||
public:
|
||||
bool shouldRecover() const
|
||||
{
|
||||
return this->shouldRecover_;
|
||||
}
|
||||
|
||||
/// Sets and saves whether Chatterino should restart on a crash
|
||||
void saveShouldRecover(bool value);
|
||||
|
||||
void initialize(Settings &settings, Paths &paths) override;
|
||||
|
||||
private:
|
||||
bool shouldRecover_ = false;
|
||||
};
|
||||
|
||||
#ifdef CHATTERINO_WITH_CRASHPAD
|
||||
std::unique_ptr<crashpad::CrashpadClient> installCrashHandler();
|
||||
#endif
|
||||
|
||||
} // namespace chatterino
|
||||
Reference in New Issue
Block a user