VirtualBox

Ignore:
Timestamp:
May 26, 2019 9:13:12 PM (6 years ago)
Author:
vboxsync
Message:

Console::i_vmstateChangeCallback/VMSTATE_OFF: Same delete NULL scenario as previously, but now with uncaught HRESULT throws on EMT thrown, as it were, into the mix. We should really forbid throwing stuff in Main, it is _clearly_ too difficult to get simple things like this half right. [fix]

File:
1 edited

Legend:

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

    r78752 r78767  
    88528852                 * deadlock).
    88538853                 */
    8854                 VMPowerDownTask *task = NULL;
     8854                VMPowerDownTask *pTask = NULL;
    88558855                try
    88568856                {
    8857                     task = new VMPowerDownTask(that, pProgress);
     8857                    pTask = new VMPowerDownTask(that, pProgress);
    88588858                }
    88598859                catch (std::bad_alloc &)
     
    88718871                 * nothing.
    88728872                 */
    8873                 if (!task->isOk())
     8873                if (pTask->isOk())
    88748874                {
    8875                     rc = task->createThread();
    8876                     task = NULL;
     8875                    rc = pTask->createThread();
     8876                    pTask = NULL;
    88778877                    if (FAILED(rc))
    88788878                        LogRelFunc(("Problem with creating thread for VMPowerDownTask.\n"));
     
    88808880                else
    88818881                {
    8882                     LogFlowFunc(("Console is already being uninitialized. (%Rhrc)\n", task->rc()));
    8883                     delete task;
     8882                    LogFlowFunc(("Console is already being uninitialized. (%Rhrc)\n", pTask->rc()));
     8883                    delete pTask;
     8884                    pTask = NULL;
    88848885                    rc = E_FAIL;
    88858886                }
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