From e3b3399bcbeebc515283cabbd788cee441a1969b Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Tue, 28 Nov 2023 12:11:45 +0100 Subject: [PATCH] Cleanup: Add constructor/destructor for drag data to avoid includes `wmDragActiveDropState` contains a `bContextStore` unique pointer, so when constructing/destructing an object of this type `BKE_context.hh` had to be included. It wouldn't be obvious why this include is necessary in some cases. And the pointer is otherwise managed internally in the source file, so the need for this include shouldn't bleed into other files. Make sure the unique pointer construction/destruction happens in the translation unit of the source file that otherwise also manages it. Avoids include in #107230. --- source/blender/windowmanager/WM_types.hh | 3 +++ source/blender/windowmanager/intern/wm_dragdrop.cc | 3 +++ 2 files changed, 6 insertions(+) diff --git a/source/blender/windowmanager/WM_types.hh b/source/blender/windowmanager/WM_types.hh index cd560372794..5916ce18c2b 100644 --- a/source/blender/windowmanager/WM_types.hh +++ b/source/blender/windowmanager/WM_types.hh @@ -1189,6 +1189,9 @@ using WMDropboxTooltipFunc = char *(*)(bContext *C, wmDropBox *drop); struct wmDragActiveDropState { + wmDragActiveDropState(); + ~wmDragActiveDropState(); + /** * Informs which dropbox is activated with the drag item. * When this value changes, the #on_enter() and #on_exit() dropbox callbacks are triggered. diff --git a/source/blender/windowmanager/intern/wm_dragdrop.cc b/source/blender/windowmanager/intern/wm_dragdrop.cc index 82df147fdfe..0646333dc1b 100644 --- a/source/blender/windowmanager/intern/wm_dragdrop.cc +++ b/source/blender/windowmanager/intern/wm_dragdrop.cc @@ -67,6 +67,9 @@ static ListBase dropboxes = {nullptr, nullptr}; static void wm_drag_free_asset_data(wmDragAsset **asset_data); static void wm_drag_free_path_data(wmDragPath **path_data); +wmDragActiveDropState::wmDragActiveDropState() = default; +wmDragActiveDropState::~wmDragActiveDropState() = default; + /* drop box maps are stored global for now */ /* these are part of blender's UI/space specs, and not like keymaps */ /* when editors become configurable, they can add own dropbox definitions */