MemoryPool icon indicating copy to clipboard operation
MemoryPool copied to clipboard

申请内存不能释放

Open haiwen007 opened this issue 2 years ago • 2 comments

image

image

参考示例:

  1. 给结构体申请内存
  2. 给结构体中变量申请内存

问题:

  1. 不能单独释放结构体变量空间?
  2. 必须通过 MemoryPoolDestroy 才可以释放内存?
  3. 图片3 这样操作,还有段错误...

haiwen007 avatar Oct 17 '24 10:10 haiwen007

image

haiwen007 avatar Oct 17 '24 10:10 haiwen007

  1. 可以的
  2. 是的,destroy才能真实释放
  3. 27行应该是sdata1,这么写把内存写坏了

userpro avatar Oct 18 '24 16:10 userpro