HookSystem: improve callback safety

This commit is contained in:
Vaxry 2024-04-20 20:16:42 +01:00
parent 1055e6bee6
commit 4ad739ec63
18 changed files with 89 additions and 105 deletions

View file

@ -20,21 +20,21 @@ class CScreencopyClient {
CScreencopyClient();
~CScreencopyClient();
int ref = 0;
wl_resource* resource = nullptr;
int ref = 0;
wl_resource* resource = nullptr;
eClientOwners clientOwner = CLIENT_SCREENCOPY;
eClientOwners clientOwner = CLIENT_SCREENCOPY;
int frameCounter = 0;
int framesInLastHalfSecond = 0;
CTimer lastMeasure;
CTimer lastFrame;
bool sentScreencast = false;
int frameCounter = 0;
int framesInLastHalfSecond = 0;
CTimer lastMeasure;
CTimer lastFrame;
bool sentScreencast = false;
void onTick();
HOOK_CALLBACK_FN* tickCallback = nullptr;
void onTick();
std::shared_ptr<HOOK_CALLBACK_FN> tickCallback;
bool operator==(const CScreencopyClient& other) const {
bool operator==(const CScreencopyClient& other) const {
return resource == other.resource;
}
};