Home > Q&A > body text
protocol buffer中通过add()相关方法,产生一个repeated属性的对象,然后把这个对象的指针放到STL容器中。 释放容器时,是需要先delete对象指针再clear容器,还是直接clear容器?
ringa_lee2017-04-17 11:25:09
I suggest you learn Chinese carefully
怪我咯2017-04-17 11:25:09
Delete the object first. Directly clearing the container will cause memory leaks.