Closed
Bug 5075
Opened 25 years ago
Closed 25 years ago
ANSI C++ violation in nsTransferable.cpp
Categories
(Core :: XUL, defect, P3)
Core
XUL
Tracking
()
VERIFIED
FIXED
People
(Reporter: bruce, Assigned: rods)
Details
nsTransferable.cpp uses a array of void* pointers to manage the data and deletes
things that were cast over to void*. This is a violation of ANSI C++ according
to the HP compiler and on any compiler should not be able to ensure that
destructors get called properly as the compiler no longer knows the type of the
object. This will be a fatal error in the future with HP's compiler and
probably others.
Reporter | ||
Comment 1•25 years ago
|
||
I meant to append the compiler output:
Error (future) 250: "../../../../widget/src/xpwidgets/nsTransferable.cpp",
line 67 # An object cannot be deleted using a pointer of type 'void *' since the
type of the object allocated is unknown. Either delete the object using the
allocated type or call operator delete directly.
delete[] data->mData;
^^^^^^^^^^^
Error (future) 250: "../../../../widget/src/xpwidgets/nsTransferable.cpp",
line 191 # An object cannot be deleted using a pointer of type 'void *' since
the type of the object allocated is unknown. Either delete the object using the
allocated type or call operator delete directly.
delete[] data->mData;
^^^^^^^^^^^
Comment 2•25 years ago
|
||
Rod, if we change the data->mData to be char*'s, we should be ok since we're just
treating this stuff as raw data...
Assignee | ||
Updated•25 years ago
|
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 3•25 years ago
|
||
This has been fixed
Reporter | ||
Updated•25 years ago
|
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•