在存在抛出构造函数的情况下解除分配

问题描述

在抛出构造函数调用 (function() { angular.module('demoApp.list',[]) .value('MyList',[ { "id": 1,"title": "ASD Headquarters","items": [ { "id": 11,"title": "SameTitle","items": [ { "id":13,"title":"Jensen Chapman's Team","items": [ { "id":14,"title":"Jimmy John" },{ "id":15,"title":"Daniel Mills" },{ "id":16,"title":"Chris Boden" } ] } ],},{ "id": 12,"title": "Irvine","items": [ { "id":23,"title":"Tracey Chapman's Team","items": [ { "id":24,"title":"San Jesus" },{ "id":25,"title":"Fat Albert" },{ "id":26,"title":"Connor McDavid" } ] } ] },{ "id":30,"title":"San Diego","items": [{ "id":31,"title":"Duran Duran's Team","items":[ { "id":32,"title":"Amberlynn Pinkerton" },{ "id":33,"title":"Tony Mejia" },{ "id":34,"title":"Richard Partridge" },{ "id":35,"title":"Elliot Stabler" } ] },{ "id":40,"title":"Steely Dan's Team","items":[ { "id":36,"title":"Tony Stark" },{ "id":37,"title":"Totally Rad" },{ "id":38,"title":"Matt Murdock" },{ "id":39,"title":"Stan Lee" } ] } ] } ] },{ "id": 2,"title": "ASD","items": [ { "id": 122,"items": [ { "id":123,"items": [ { "id":124,{ "id":125,{ "id":126,{ "id": 127,"items": [ { "id":128,"items": [ { "id":129,{ "id":130,{ "id":140,{ "id":320,"items": [{ "id":235,"items":[ { "id":855,{ "id":963,{ "id":874,{ "id":8645,{ "id":946,"items":[ { "id":878,{ "id":020,{ "id":29526,"title":"Stan Lee" } ] } ] } ] } ]); })() 不会泄漏内存,因为显然所有这些都是由 new 运算符处理的。我假设对于用户定义的 new/delete 运算符,这不会立即发生,但是 new 报告我的测试程序没有内存泄漏(只是进程正在终止):

valgrind

在我的情况下,内存是如何释放的?当构造函数也抛出认的 new 运算符时,是否保证释放内存?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)