Closed Bug 5075 Opened 25 years ago Closed 25 years ago

ANSI C++ violation in nsTransferable.cpp

Categories

(Core :: XUL, defect, P3)

defect

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.
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; ^^^^^^^^^^^
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...
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
This has been fixed
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.