Has any one seen this error ("scalar deleting destructor") in the call
stack? I've found two old KB articles, neither of which seem to apply
to what I'm doing. I'm not in a DLL and I'm using verion 4.2b.
I think I'm doing something pretty simple. I have a class derived from
CObject that contains a CString object. Any time I delete these light
weight objects (after 'new'ing them) I get the "scalar deleting
destructor" on the call stack.
Any tips and/or pointers ;) would be *greatly* appreciated.
Thank you very much,
Kelli
Kelli <ke...@inlet.com> wrote in article <33414F...@inlet.com>...
I checked, and all destructors are virtual. (Both for the CView base
and derived classes and my classes.) Is this a bogus message? Or is
there something truely wrong here?
Thanx for your time,
Kelli
Kelli,
What makes you feel that this is an error. Scaler deleting destructors
are created by the compiler whenever you use the delete operator. If
you have set a breakpoint in the middle of code which is doing a delete,
you are likely to see this synthetic function name on the return stack.
Ron Martin
Ann Arbor, MI
I think I got started on this when I had a GPF and the only thing (at
the time) I could see was the Scalar Deleting Destructor that looked out
of place. The only thing I could find on it was two KB articles talking
about this being an error. I've done a little more looking and now can
see that I shouldn't be concerned about it, it was never part of my
problem.
Thank you for your time and response,
It's neither an error nor a warning. It's a function the compiler
generates to implement the delete operator. It calls the object's
destructor, then frees the object's memory. If you new and delete
arrays of objects, you will see the "vector deleting destructor"
instead.
The scalar deleting destructor takes a flag parameter on the stack that
tells it whether or not to free the memory. I seem to recall reading
about a bug in some versions of VC++ where, if you used placement new to
create an object, then explicitly invoked its destructor, it would call
the scalar deleting destructor, but without pushing the flag parameter.
This would both mess up the stack, and pseudo-randomly try to free the
object's memory.
--
J.T. Anderson
PLATINUM technolgy, Los Angeles Laboratory
jtand...@platinum.com
In my cases, I've seen these messages pop up on the debug window saying to
the effect,
"warning. scalar delete destructor called in window distructor. Base class
distructor will not be called."
--
Richard Lewis Haggard
hag...@world.std.com
Haggard & Associates, International
> It's neither an error nor a warning. It's a function the compiler
Richard Lewis Haggard <hag...@world.std.com> wrote in article
<01bc4059$b3075340$5234...@dell90.vivo.com>...
> Thank you for your reply. I guess it is the terminology that is giving me
> difficulty. The meaning of the message is not easy to discern. Why is it
> called scalar? Why is the other called a vector? A scalar to me is
> something that is linearly arranged in regular periodic units. A vector
is
> means to express a direction combined with a magnitude.
>
In mathematics, scalar multiplication is when you multiply a vector (or
matrix) times a single "real" number. Vectors are (linear) ordered
collections of real numbers. So scalar is singular and vector is plural.