mirror of
https://github.com/libretro/Play-.git
synced 2024-12-01 04:30:55 +00:00
21 lines
367 B
C++
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();
|
|
}
|
|
}
|