Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. scaler deleting destructor

scaler deleting destructor

Scheduled Pinned Locked Moved C / C++ / MFC
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Deepu Antony
    wrote on last edited by
    #1

    Hi all Can anybody tell me what is scalar deleting destructor. When i try to delete a class pointer which is derived from CWnd it is showing this error. class CGraphTollTip : public CWnd { .... .... } class CGraphicsView : public CScrollView { .... .... CGraphTollTip *m_wndGraphTollTip; void CGraphicsView::OnInitialUpdate() { .... m_wndGraphTollTip=new CGraphTollTip[SomeValue]; .... .... } CGraphicsView::~CGraphicsView() { delete [] m_wndGraphTollTip; } .... .... } While deleting m_wndGraphTollTip i am getting this error in vc6.0 callstack. Please help me.

    M 1 Reply Last reply
    0
    • D Deepu Antony

      Hi all Can anybody tell me what is scalar deleting destructor. When i try to delete a class pointer which is derived from CWnd it is showing this error. class CGraphTollTip : public CWnd { .... .... } class CGraphicsView : public CScrollView { .... .... CGraphTollTip *m_wndGraphTollTip; void CGraphicsView::OnInitialUpdate() { .... m_wndGraphTollTip=new CGraphTollTip[SomeValue]; .... .... } CGraphicsView::~CGraphicsView() { delete [] m_wndGraphTollTip; } .... .... } While deleting m_wndGraphTollTip i am getting this error in vc6.0 callstack. Please help me.

      M Offline
      M Offline
      Maxwell Chen
      wrote on last edited by
      #2

      Here is the checklist: 1. Review the destructor of CGraphTollTip. Maybe it does delete this in its destructor. 2. Validate the pointer array when you are going to delete it.

      CGraphicsView::~CGraphicsView()
      {
      if(m_wndGraphTollTip) {
      delete [] wndGraphTollTip;
      }
      }

      Maxwell Chen

      D 1 Reply Last reply
      0
      • M Maxwell Chen

        Here is the checklist: 1. Review the destructor of CGraphTollTip. Maybe it does delete this in its destructor. 2. Validate the pointer array when you are going to delete it.

        CGraphicsView::~CGraphicsView()
        {
        if(m_wndGraphTollTip) {
        delete [] wndGraphTollTip;
        }
        }

        Maxwell Chen

        D Offline
        D Offline
        Deepu Antony
        wrote on last edited by
        #3

        I have checked the destructor of CGraphTollTip.In that delete this is not there Also in CGraphicsView destructor i had validated the pointer but still the problem is not solved.

        M 1 Reply Last reply
        0
        • D Deepu Antony

          I have checked the destructor of CGraphTollTip.In that delete this is not there Also in CGraphicsView destructor i had validated the pointer but still the problem is not solved.

          M Offline
          M Offline
          Maxwell Chen
          wrote on last edited by
          #4

          These two discussions (PCreview[^] and CodeGuru[^]) talked the same thing. Maybe they help... :)

          Maxwell Chen

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups