VirtualBox

Changeset 29580 in vbox for trunk/src/VBox


Ignore:
Timestamp:
May 17, 2010 6:23:00 PM (15 years ago)
Author:
vboxsync
Message:

Main: avoid clearing vtable with memset

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/ConsoleImpl.cpp

    r29550 r29580  
    441441    unconst(mControl) = aControl;
    442442
    443     memset(&mCallbackData, 0, sizeof(mCallbackData));
     443    mCallbackData.clear();
    444444
    445445    /* Cache essential properties and objects */
     
    56425642
    56435643    if (SUCCEEDED(rc))
    5644     {
    5645         /* uninit dynamically allocated members of mCallbackData */
    5646         if (mCallbackData.mpsc.valid)
    5647             mCallbackData.mpsc.shape.setNull();
    5648         memset(&mCallbackData, 0, sizeof(mCallbackData));
    5649     }
     5644        mCallbackData.clear();
    56505645
    56515646    /* complete the progress */
  • trunk/src/VBox/Main/include/ConsoleImpl.h

    r29518 r29580  
    699699        }
    700700        klc;
     701
     702        void clear()
     703        {
     704            /* We cannot do memset() on mpsc to avoid cleaning shape's vtable */
     705            mpsc.shape.setNull();
     706            mpsc.valid = mpsc.visible = mpsc.alpha = false;
     707            mpsc.xHot = mpsc.yHot = mpsc.width = mpsc.height = 0;
     708            ::memset(&mcc, 0, sizeof mcc);
     709            ::memset(&klc, 0, sizeof klc);
     710        }
    701711    }
    702712    mCallbackData;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette