search

Home  >  Q&A  >  body text

protocol buffer中C++相关的api问题

protocol buffer中通过add()相关方法,产生一个repeated属性的对象,然后把这个对象的指针放到STL容器中。
释放容器时,是需要先delete对象指针再clear容器,还是直接clear容器?

ringa_leeringa_lee2767 days ago719

reply all(2)I'll reply

  • ringa_lee

    ringa_lee2017-04-17 11:25:09

    I suggest you learn Chinese carefully

    reply
    0
  • 怪我咯

    怪我咯2017-04-17 11:25:09

    Delete the object first. Directly clearing the container will cause memory leaks.

    reply
    0
  • Cancelreply