Skip to content

Commit

Permalink
[*] 宏Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
acgist committed Feb 26, 2024
1 parent 2dbb0bb commit 2b55b8d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions boot/main/src/source/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,32 @@

// 回调绑定
#ifndef CALLBACK_BINDER
#define CALLBACK_BINDER(name) \
#define CALLBACK_BINDER(name) \
this->name##ButtonPtr->callback([](Fl_Widget* widgetPtr, void* voidPtr) -> void { \
((MainWindow*) voidPtr)->name##(); \
((MainWindow*) voidPtr)->name(); \
}, this);
#endif

// 删除资源指针
#ifndef DELETE_MEDIA_PTR
#define DELETE_MEDIA_PTR(mediaType) \
SPDLOG_DEBUG("释放" #mediaType "资源"); \
#define DELETE_MEDIA_PTR(mediaType) \
SPDLOG_DEBUG("释放" #mediaType "资源"); \
if(this->mediaType##GcPtr != nullptr) { \
delete this->mediaType##GcPtr; \
this->mediaType##GcPtr = nullptr; \
} \
} \
if(this->mediaType##TsPtr != nullptr) { \
delete this->mediaType##TsPtr; \
this->mediaType##TsPtr = nullptr; \
} \
} \
if(this->mediaType##GcWindowPtr != nullptr) { \
delete this->mediaType##GcWindowPtr; \
this->mediaType##GcWindowPtr = nullptr; \
} \
} \
if(this->mediaType##TsWindowPtr != nullptr) { \
delete this->mediaType##TsWindowPtr; \
this->mediaType##TsWindowPtr = nullptr; \
} \
} \
if(this->mediaType##GroupPtr != nullptr) { \
delete this->mediaType##GroupPtr; \
this->mediaType##GroupPtr = nullptr; \
Expand Down
8 changes: 4 additions & 4 deletions core/src/header/Ptr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ namespace {

// 删除指针
#ifndef DELETE_PTR
# define DELETE_PTR(ptr) \
if(this->##ptr != nullptr) { \
delete this->##ptr; \
##ptr = nullptr; \
# define DELETE_PTR(ptr) \
if(this->ptr != nullptr) { \
delete this->ptr; \
this->ptr = nullptr; \
}
#endif

Expand Down

0 comments on commit 2b55b8d

Please sign in to comment.