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

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.

主站蜘蛛池模板: 广饶县| 昌黎县| 长汀县| 黔东| 宜阳县| 景宁| 额济纳旗| 浙江省| 乐昌市| 吴堡县| 彩票| 丰原市| 江口县| 日土县| 长寿区| 湖口县| 正蓝旗| 民和| 绥德县| 贞丰县| 淮安市| 镇沅| 洪湖市| 泊头市| 呈贡县| 瑞安市| 美姑县| 康乐县| 淮阳县| 延寿县| 灵山县| 崇文区| 阜南县| 兴文县| 哈密市| 磐石市| 新邵县| 疏附县| 曲沃县| 冕宁县| 阿克苏市|