1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:27:45 +00:00

LibCore: Remove data pointer from CustomEvent

It wasn't used anywhere.

Also, if it were used, then it should have been marked AK_NONCOPYABLE().
Or even more cleanly, it should use a RefPtr<> or OwnPtr<> instead of
a 'naked' pointer. And because I didn't want to impose any such decision
on a possible future use case that we don't even know, I just removed
that unused feature.
This commit is contained in:
Ben Wiederhake 2020-08-26 22:05:52 +02:00 committed by Andreas Kling
parent e5807d17b2
commit 6454969d6b

View file

@ -143,21 +143,17 @@ private:
class CustomEvent : public Event {
public:
CustomEvent(int custom_type, void* data = nullptr)
CustomEvent(int custom_type)
: Event(Event::Type::Custom)
, m_custom_type(custom_type)
, m_data(data)
{
}
~CustomEvent() { }
int custom_type() const { return m_custom_type; }
void* data() { return m_data; }
const void* data() const { return m_data; }
private:
int m_custom_type { 0 };
void* m_data { nullptr };
};
}