# Avoiding overriding the global operators new, delete

**URL:** <https://forums.unrealengine.com/t/avoiding-overriding-the-global-operators-new-delete/1593241>\
**Category:** Platform & Builds\
**Tags:** unreal-engine, memory, question\
**Created:** [January 6, 2024, 2:34pm UTC](https://forums.unrealengine.com/t/avoiding-overriding-the-global-operators-new-delete/1593241 "2024-01-06T14:34:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ivazhuk](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ivazhuk](https://forums.unrealengine.com/u/Ivazhuk)\
**Post date:** [January 6, 2024, 2:34pm UTC](https://forums.unrealengine.com/t/avoiding-overriding-the-global-operators-new-delete/1593241/1 "2024-01-06T14:34:27Z")

</div>

Hi everybody,

In one of my game modules, global operators **new** , **delete** cannot be overridden. To do this, in my module I can define a custom macro IMPLEMENT\_MODULE (for example IMPLEMENT\_MODULE2) where I will delete the line for overriding the operators new, delete:

```auto
#if IS_MONOLITHIC

#define IMPLEMENT_MODULE2( ModuleImplClass, ModuleName ) \
		static FStaticallyLinkedModuleRegistrant< ModuleImplClass > ModuleRegistrant##ModuleName( TEXT(#ModuleName) ); \
		extern "C" void IMPLEMENT_MODULE_##ModuleName() { } \
		PER_MODULE_BOILERPLATE_ANYLINK(ModuleImplClass, ModuleName)

#else

#define IMPLEMENT_MODULE2( ModuleImplClass, ModuleName ) \
		extern "C" DLLEXPORT IModuleInterface* InitializeModule() \
		{ \
			return new ModuleImplClass(); \
		} \
		extern "C" void IMPLEMENT_MODULE_##ModuleName() { } \
		UE4_VISUALIZERS_HELPERS \
		//REPLACEMENT_OPERATOR_NEW_AND_DELETE \
		PER_MODULE_BOILERPLATE_ANYLINK(ModuleImplClass, ModuleName)

#endif //IS_MONOLITHIC

```

And now I announce the implementation of my module:

```auto
IMPLEMENT_MODULE2(FMyModuleModule, MyModule)

```

This seems to work, provided I don’t use UObject-inherited objects in this module. But I don’t really understand why the global operators new and delete are overridden, so I suspect there may be potential problems.

Can I use this code and what potential problems might arise when using it?

---

<div class="post-metadata">

**Author:** ![Dariusz1989](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dariusz1989](https://forums.unrealengine.com/u/Dariusz1989)\
**Post date:** [January 25, 2026, 8:48am UTC](https://forums.unrealengine.com/t/avoiding-overriding-the-global-operators-new-delete/1593241/2 "2026-01-25T08:48:16Z")

</div>

Hey

Did this work for you at the ened?

Tried on my end lately but got some compile errors, looks like stuff cahnged in 5.5.4 +? Tricky.
