由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - 谁给讲讲cross DLL problem?
相关主题
how to resolve this problem?new了指针,delete的时候出错了
[合集] c++ delete问题Re: 一个DLL的问题
new一定要和delete配对吗?Help: any good decompiler for DLL
c++设计一问:如何动态地调用不同的算法的dll ?要写 Visual C 下的 DLL 东西
Dynamic buffer management questionQuestion about COM
[合集] 问个题--- web dynamic graphic generationHow to find the DLL dependency of an EXE file?
backend language of choice为什么我的visual C++ 找不到 "Stdafx.h" ?
linux 能查到 deleted file list 吗请教:how to call a COM object in a stored procedure? (转载)
相关话题的讨论汇总
话题: dll话题: problem话题: tr1话题: cross话题: 讲讲
进入Programming版参与讨论
1 (共1页)
n****y
发帖数: 106
1
effective c++ 里面的这么一段:
This problem crops up when an object is created using new in one dynamically
linked library (DLL) but is deleted in a different DLL. On many platforms,
such cross-DLL new/delete pairs lead to runtime errors. tr1::shared_ptr
avoids the problem, because its default deleter uses delete from the same
DLL where the tr1::shared_ptr is created.
看的不是很懂.
谁给讲讲? thanks.
比如举个例子?
x****u
发帖数: 44466
2
这是个编译和链接的问题,在不同dll里面的new与delete可能被链接到不同的代码,这
样也许会造成用一个内存管理的实现去释放另一个内存管理的实现分配的内存,从而带
来怪异问题。

dynamically
,

【在 n****y 的大作中提到】
: effective c++ 里面的这么一段:
: This problem crops up when an object is created using new in one dynamically
: linked library (DLL) but is deleted in a different DLL. On many platforms,
: such cross-DLL new/delete pairs lead to runtime errors. tr1::shared_ptr
: avoids the problem, because its default deleter uses delete from the same
: DLL where the tr1::shared_ptr is created.
: 看的不是很懂.
: 谁给讲讲? thanks.
: 比如举个例子?

1 (共1页)
进入Programming版参与讨论
相关主题
请教:how to call a COM object in a stored procedure? (转载)Dynamic buffer management question
how to link DLL staticly in visual c# ?[合集] 问个题--- web dynamic graphic generation
linker problem in VCbackend language of choice
a simple DLL and EXE questionlinux 能查到 deleted file list 吗
how to resolve this problem?new了指针,delete的时候出错了
[合集] c++ delete问题Re: 一个DLL的问题
new一定要和delete配对吗?Help: any good decompiler for DLL
c++设计一问:如何动态地调用不同的算法的dll ?要写 Visual C 下的 DLL 东西
相关话题的讨论汇总
话题: dll话题: problem话题: tr1话题: cross话题: 讲讲