From f3bc272eae77d088fe48de40bb50b094196d9a63 Mon Sep 17 00:00:00 2001 From: IlyaShurupov Date: Wed, 20 Mar 2024 10:01:05 +0300 Subject: [PATCH] Widget Example added --- Allocators/private/HeapAllocatorGlobal.cpp | 4 +++- CMakeLists.txt | 1 - CMakeOptions.txt | 4 ++-- Widgets/private/WidgetConfig.cpp | 4 +++- Widgets/public/WidgetConfig.hpp | 4 ++++ 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Allocators/private/HeapAllocatorGlobal.cpp b/Allocators/private/HeapAllocatorGlobal.cpp index c46df45..8f6450e 100644 --- a/Allocators/private/HeapAllocatorGlobal.cpp +++ b/Allocators/private/HeapAllocatorGlobal.cpp @@ -32,7 +32,7 @@ tp::MemHead* tp::HeapAllocGlobal::mEntry = nullptr; tp::ualni tp::HeapAllocGlobal::mNumAllocations = 0; std::mutex tp::HeapAllocGlobal::mMutex; bool tp::HeapAllocGlobal::mIgnore = true; -bool tp::HeapAllocGlobal::mEnableCallstack = false; +bool tp::HeapAllocGlobal::mEnableCallstack = true; #ifdef MEM_STACK_TRACE tp::CallStackCapture tp::HeapAllocGlobal::mCallstack; @@ -57,6 +57,8 @@ namespace tp { uhalni mIgnored; #ifdef MEM_STACK_TRACE const CallStackCapture::CallStack* mCallStack; +#else + void* p; #endif }; } diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f9f17f..fbc0ec6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,6 @@ set(CMAKE_CXX_STANDARD 20) # set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/./tmp/install) # set(CMAKE_CXX_FLAGS "-fuse-ld=lld-15 ${CMAKE_CXX_FLAGS} -gdwarf-4 ") -add_compile_definitions(MEM_DEBUG) project(ModulesRoot) diff --git a/CMakeOptions.txt b/CMakeOptions.txt index 5768530..2a080ad 100644 --- a/CMakeOptions.txt +++ b/CMakeOptions.txt @@ -1,5 +1,5 @@ -option(MODULES_MEMORY_DEBUG "Debug memory" ON) -option(MODULES_MEMORY_DEBUG_STACK_TRACE "Record stack info on memory debug" ON) +option(MODULES_MEMORY_DEBUG "Debug memory" OFF) +option(MODULES_MEMORY_DEBUG_STACK_TRACE "Record stack info on memory debug" OFF) set(WINDOWS_LIBRARIES "../../ModulesWindowsLibraries" CACHE STRING "Svn repository with windows libraries https://svn.riouxsvn.com/moduleswindowsl") diff --git a/Widgets/private/WidgetConfig.cpp b/Widgets/private/WidgetConfig.cpp index 87543d7..0f09b55 100644 --- a/Widgets/private/WidgetConfig.cpp +++ b/Widgets/private/WidgetConfig.cpp @@ -1,9 +1,11 @@ #include "WidgetBase.hpp" +#include "Graphics.hpp" + namespace tp { GlobalGUIConfig* gGlobalGUIConfig = nullptr; - ModuleManifest* deps[] = { &gModuleStrings, nullptr }; + ModuleManifest* deps[] = { &gModuleGraphics, &gModuleStrings, nullptr }; ModuleManifest gModuleWidgets = ModuleManifest("Widgets", nullptr, nullptr, deps); } \ No newline at end of file diff --git a/Widgets/public/WidgetConfig.hpp b/Widgets/public/WidgetConfig.hpp index cf72b22..77579ae 100644 --- a/Widgets/public/WidgetConfig.hpp +++ b/Widgets/public/WidgetConfig.hpp @@ -66,6 +66,10 @@ namespace tp { } Map configs; + + ~GlobalGUIConfig() { + configs.removeAll(); + } }; extern GlobalGUIConfig* gGlobalGUIConfig;