官术网_书友最值得收藏!

Introduction

Memory management is always one of the most important things to get right in your computer program to ensure stability and good, bug-free operation of your code. A dangling pointer (pointer referring to something that has been removed from memory) is an example of a bug that is hard to track if it occurs.

In any computer program, memory management is extremely important. UE4's UObject reference counting system is the default way that memory is managed for Actors and UObject derivatives. This is the default way that your memory will be managed within your UE4 program.

If you write custom C++ classes of your own, which do not derive from UObject, you may find the TSharedPtr / TWeakPtr reference counted classes useful. These classes provide reference counting and automatic deletion for 0 reference objects.

This chapter provides recipes for memory management within UE4.

主站蜘蛛池模板: 金平| 黑龙江省| 二连浩特市| 双峰县| 砀山县| 城口县| 哈密市| 张北县| 湖口县| 岫岩| 遵义市| 南丰县| 广宁县| 河间市| 中西区| 嵊泗县| 定西市| 上栗县| 双流县| 梨树县| 梅河口市| 江安县| 阿巴嘎旗| 乌鲁木齐县| 峨眉山市| 司法| 高唐县| 景谷| 珲春市| 行唐县| 靖江市| 新民市| 习水县| 安新县| 兴仁县| 新兴县| 永春县| 景东| 辽中县| 雅江县| 密云县|