本文介绍了释放非托管STL对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 HI, 假设我有一个类(在C ++上),它有一个STRMAP的非托管STL成员,它是 map< string的定义,string> ;. class CL { public CL(){mp = new STRMAP()}; public void Dispose(删除mp); STRMAP * mp; //未损坏的对象 } 成员影响类对象如何足以删除mp删除stl对象表格 内存? GC会收集这样的非管理吗? 谢谢, Andrey Say i have a class(on C++) which has an unmanaged STL member of STRMAP which is a define formap<string, string>. class CL{public CL(){mp = new STRMAP()};public void Dispose(delete mp);STRMAP *mp; //unmamaged object} member affects how the class objectIs it enough to just "delete mp" to remove the stl object formmemory? Does having such an unmanaged wil be collected by GC? Thank you,Andrey推荐答案 IMO OP并没有说它是用托管C ++编写的,例如你是* b $ b显示是基于(未发布的)C ++ / CLI语言修订版,OP'' 应用程序不是使用C ++ / CLI编写的(我想)。 /> Willy。 IMO OP didn''t say it was written using managed C++, the example you areshowing is based on the (unreleased) C++/CLI language revision, OP''sapplication is not written using C++/CLI (I suppose). Willy. IMO OP并没有说它是用托管C ++编写的,你的例子是显示基于(未发布的)C ++ / CLI语言版本,OP'的应用程序不是使用C ++ / CLI编写的(我想)。 Willy。 IMO OP didn''t say it was written using managed C++, the example you are showing is based on the (unreleased) C++/CLI language revision, OP''s application is not written using C++/CLI (I suppose). Willy. 这篇关于释放非托管STL对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-16 11:14