Author |
Message |
Kell #1 / 9
|
 "scalar deleting destructor"
Hello all! 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 --
http://www.*-*-*.com/
|
Sat, 18 Sep 1999 03:00:00 GMT |
|
 |
Joseph M. O'Lear #2 / 9
|
 "scalar deleting destructor"
Make sure the destructor of your derived class is declared as virtual.
Quote: > Hello all! > 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 > --
> http://www.inlet.com
|
Sat, 18 Sep 1999 03:00:00 GMT |
|
 |
Kell #3 / 9
|
 "scalar deleting destructor"
wizard created project's View destructor, it has a "scalar deleting destructor" message on the call stack. That's with none of my code in there. 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 Quote:
> Make sure the destructor of your derived class is declared as virtual.
> > Hello all! > > 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 > > --
> > http://www.inlet.com
|
Sun, 19 Sep 1999 03:00:00 GMT |
|
 |
Ronald M. Marti #4 / 9
|
 "scalar deleting destructor"
Quote:
> wizard created project's View destructor, it has a "scalar deleting > destructor" message on the call stack. That's with none of my code in > there. > 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
> > Make sure the destructor of your derived class is declared as virtual.
> > > Hello all! > > > 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 > > > --
> > > http://www.inlet.com
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
|
Sun, 19 Sep 1999 03:00:00 GMT |
|
 |
Kell #5 / 9
|
 "scalar deleting destructor"
Quote:
> 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, Kelli --
http://www.inlet.com
|
Sun, 19 Sep 1999 03:00:00 GMT |
|
 |
Richard Lewis Haggar #6 / 9
|
 "scalar deleting destructor"
What the heck is a scalar deleting destructor, anyway? Although I've been the victum of this warning/error before I've never understood what it was. The phraseology is such that I can't even hold the words in my head for 5 seconds, little alone derive any sort of meaning from them. -- Richard Lewis Haggard
Haggard & Associates, International
|
Mon, 20 Sep 1999 03:00:00 GMT |
|
 |
J.T. Anderso #7 / 9
|
 "scalar deleting destructor"
Quote:
> What the heck is a scalar deleting destructor, anyway? Although I've been > the victum of this warning/error before I've never understood what it was. > The phraseology is such that I can't even hold the words in my head for 5 > seconds, little alone derive any sort of meaning from them.
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
|
Mon, 20 Sep 1999 03:00:00 GMT |
|
 |
Richard Lewis Haggar #8 / 9
|
 "scalar deleting destructor"
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 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
Haggard & Associates, International Quote: > 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
|
Mon, 20 Sep 1999 03:00:00 GMT |
|
 |
Scott Gilber #9 / 9
|
 "scalar deleting destructor"
Quote: > 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.
|
Mon, 20 Sep 1999 03:00:00 GMT |
|
|