aboutsummaryrefslogtreecommitdiff
path: root/src/ui/DeleteLater.cpp
blob: 499b9b349584d4cb8cb47263cd7888c4d38bd134 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "cru/ui/DeleteLater.h"

#include "Helper.h"
#include "cru/platform/gui/UiApplication.h"

namespace cru::ui {

DeleteLaterImpl::DeleteLaterImpl() : delete_later_scheduled_(false) {}

DeleteLaterImpl::~DeleteLaterImpl() {}

void DeleteLaterImpl::DeleteLater() {
  if (!delete_later_scheduled_) {
    GetUiApplication()->SetImmediate([this] { delete this; });
    delete_later_scheduled_ = true;
  }
}

void DeleteLaterImpl::OnPrepareDelete() {}
}  // namespace cru::ui