VirtualBox

Changeset 69398 in vbox for trunk/src/VBox/Main/src-server


Ignore:
Timestamp:
Oct 26, 2017 6:58:20 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
118725
Message:

Main/Medium: Back out previous change, it had good intentions but broke things in a different way. This needs to be fixed elsewhere.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/MediumImpl.cpp

    r69330 r69398  
    47694769            /* use the existing progress object... */
    47704770            pProgress = *aProgress;
    4771         }
    4772         else
    4773         {
     4771
    47744772            /* ...but create a new one if it is null */
    4775 
    4776             pProgress.createObject();
    4777             rc = pProgress->init(m->pVirtualBox,
    4778                                  static_cast<IMedium*>(this),
    4779                                  BstrFmt(tr("Creating differencing medium storage unit '%s'"),
    4780                                          aTarget->m->strLocationFull.c_str()).raw(),
    4781                                  TRUE /* aCancelable */);
    4782             if (FAILED(rc))
    4783                 throw rc;
     4773            if (pProgress.isNull())
     4774            {
     4775                pProgress.createObject();
     4776                rc = pProgress->init(m->pVirtualBox,
     4777                                     static_cast<IMedium*>(this),
     4778                                     BstrFmt(tr("Creating differencing medium storage unit '%s'"),
     4779                                             aTarget->m->strLocationFull.c_str()).raw(),
     4780                                     TRUE /* aCancelable */);
     4781                if (FAILED(rc))
     4782                    throw rc;
     4783            }
    47844784        }
    47854785
     
    51135113            /* use the existing progress object... */
    51145114            pProgress = *aProgress;
    5115         }
    5116         else
    5117         {
     5115
    51185116            /* ...but create a new one if it is null */
    51195117            if (pProgress.isNull())
     
    57895787            /* use the existing progress object... */
    57905788            pProgress = *aProgress;
    5791         }
    5792         else
    5793         {
     5789
    57945790            /* ...but create a new one if it is null */
    5795             Utf8Str tgtName;
    5796             {
    5797                 AutoReadLock alock(pTarget COMMA_LOCKVAL_SRC_POS);
    5798                 tgtName = pTarget->i_getName();
    5799             }
    5800 
    5801             AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    5802 
    5803             pProgress.createObject();
    5804             rc = pProgress->init(m->pVirtualBox,
    5805                                  static_cast<IMedium*>(this),
    5806                                  BstrFmt(tr("Merging medium '%s' to '%s'"),
    5807                                          i_getName().c_str(),
    5808                                          tgtName.c_str()).raw(),
    5809                                  TRUE /* aCancelable */);
    5810             if (FAILED(rc))
    5811                 throw rc;
     5791            if (pProgress.isNull())
     5792            {
     5793                Utf8Str tgtName;
     5794                {
     5795                    AutoReadLock alock(pTarget COMMA_LOCKVAL_SRC_POS);
     5796                    tgtName = pTarget->i_getName();
     5797                }
     5798
     5799                AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     5800
     5801                pProgress.createObject();
     5802                rc = pProgress->init(m->pVirtualBox,
     5803                                     static_cast<IMedium*>(this),
     5804                                     BstrFmt(tr("Merging medium '%s' to '%s'"),
     5805                                             i_getName().c_str(),
     5806                                             tgtName.c_str()).raw(),
     5807                                     TRUE /* aCancelable */);
     5808                if (FAILED(rc))
     5809                    throw rc;
     5810            }
    58125811        }
    58135812
     
    58295828        {
    58305829            rc = pTask->runNow();
     5830
    58315831            delete pTask;
    58325832        }
Note: See TracChangeset for help on using the changeset viewer.

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