Play-/Source/ScopedVmPauser.cpp
Jean-Philip Desjardins 516df237f8 Cleanup.
2016-01-15 21:43:03 -05:00

21 lines
367 B
C++

#include "ScopedVmPauser.h"
#include "VirtualMachine.h"
CScopedVmPauser::CScopedVmPauser(CVirtualMachine& virtualMachine)
: m_virtualMachine(virtualMachine)
{
if(m_virtualMachine.GetStatus() == CVirtualMachine::RUNNING)
{
m_paused = true;
m_virtualMachine.Pause();
}
}
CScopedVmPauser::~CScopedVmPauser()
{
if(m_paused)
{
m_virtualMachine.Resume();
}
}