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

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.

主站蜘蛛池模板: 海林市| 开化县| 渭南市| 新乡县| 新乡市| 庆元县| 温州市| 普兰店市| 开化县| 新营市| 洪洞县| 左云县| 汉寿县| 榆社县| 昭苏县| 柞水县| 谷城县| 江川县| 潍坊市| 武邑县| 峨眉山市| 沂南县| 山阴县| 乐陵市| 吐鲁番市| 贵溪市| 龙川县| 河东区| 南阳市| 古浪县| 北宁市| 个旧市| 邓州市| 湛江市| 嘉峪关市| 德安县| 旺苍县| 林州市| 益阳市| 尖扎县| 和硕县|