Skip to content

Commit

Permalink
Add needed virtual destructor to the (map) Worker class.
Browse files Browse the repository at this point in the history
This is needed because MapUpdater::WorkerThread() can delete objects
of derived classes, like MapUpdateWorker, via a pointer to base class,
and without a virtual destructor this isn't calling the correct
destructor!

Closes #499
  • Loading branch information
evil-at-wow authored and killerwife committed May 24, 2023
1 parent c3c006e commit 6c9e102
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/game/Maps/MapWorkers.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class Worker
{
public:
Worker(MapUpdater& updater) : m_updater(updater) {}
virtual ~Worker() = default;
virtual void execute() {};

protected:
Expand Down Expand Up @@ -107,4 +108,4 @@ class ObjectUpdateWorker : public Worker
uint32 m_diff;
};

#endif //_MAP_WORKERS_H_INCLUDED
#endif //_MAP_WORKERS_H_INCLUDED

0 comments on commit 6c9e102

Please sign in to comment.