mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:47:44 +00:00
WindowServer: Make message receivers be weak pointers.
This commit is contained in:
parent
95cfa49f1b
commit
d77f8ba413
5 changed files with 28 additions and 27 deletions
|
@ -5,6 +5,7 @@
|
|||
#include <AK/OwnPtr.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <AK/Function.h>
|
||||
#include <AK/WeakPtr.h>
|
||||
|
||||
class WSMessageReceiver;
|
||||
struct WSAPI_ClientMessage;
|
||||
|
@ -17,7 +18,7 @@ public:
|
|||
|
||||
int exec();
|
||||
|
||||
void post_message(WSMessageReceiver* receiver, OwnPtr<WSMessage>&&);
|
||||
void post_message(WSMessageReceiver& receiver, OwnPtr<WSMessage>&&);
|
||||
|
||||
static WSMessageLoop& the();
|
||||
|
||||
|
@ -36,7 +37,7 @@ private:
|
|||
void drain_keyboard();
|
||||
|
||||
struct QueuedMessage {
|
||||
WSMessageReceiver* receiver { nullptr };
|
||||
WeakPtr<WSMessageReceiver> receiver;
|
||||
OwnPtr<WSMessage> message;
|
||||
};
|
||||
Vector<QueuedMessage> m_queued_messages;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue