Changeset 719


Ignore:
Timestamp:
12/5/2008 11:53:24 PM (6 years ago)
Author:
lowjoel
Message:

Fixed a memory leak when using GetSeparator?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/ShellExt/CtxMenu.cpp

    r716 r719  
    185185        if (applicableActions & ACTION_ERASE_ON_RESTART) 
    186186        { 
    187             InsertMenu    (hSubmenu, ACTION_ERASE_ON_RESTART, MF_BYPOSITION, uID++, _T("Erase on &Restart")); 
     187            InsertMenu    (hSubmenu, ACTION_ERASE_ON_RESTART, MF_BYPOSITION, uID++,     _T("Erase on &Restart")); 
    188188            VerbMenuIndices.push_back(ACTION_ERASE_ON_RESTART); 
    189189        } 
     
    197197        { 
    198198            if (uID - uidFirstCmd > 0) 
    199                 InsertMenuItem(hSubmenu, 0, FALSE, GetSeparator()); 
     199            { 
     200                std::auto_ptr<MENUITEMINFO> separator(GetSeparator()); 
     201                InsertMenuItem(hSubmenu, 0, FALSE, separator); 
     202            } 
     203 
    200204            InsertMenu    (hSubmenu, ACTION_SECURE_MOVE, MF_BYPOSITION, uID++,          _T("Secure &Move")); 
    201205            VerbMenuIndices.push_back(ACTION_SECURE_MOVE); 
     
    478482                std::wstringstream strm; 
    479483                strm << L"An invalid command with the ID " 
    480                     << VerbMenuIndices[LOWORD(pCmdInfo->lpVerb)] << L"was requested.\n\n" 
     484                    << VerbMenuIndices[LOWORD(pCmdInfo->lpVerb)] << L" was requested.\n\n" 
    481485                    << L"Eraser was unable to process the request."; 
    482486                MessageBox(pCmdInfo->hwnd, strm.str().c_str(), L"Eraser Shell Extension", MB_OK | MB_ICONERROR); 
     
    604608    MENUITEMINFO* CCtxMenu::GetSeparator() 
    605609    { 
    606         MENUITEMINFO *mii = new MENUITEMINFO(); 
     610        MENUITEMINFO* mii = new MENUITEMINFO(); 
    607611        mii->cbSize = sizeof(MENUITEMINFO); 
    608612        mii->fMask = MIIM_TYPE; 
Note: See TracChangeset for help on using the changeset viewer.