mirror of
https://github.com/AppleWin/AppleWin.git
synced 2024-12-22 09:30:15 +00:00
SyncEvents: ensure MB & Mouse have removed their events for a restart
This commit is contained in:
parent
30d3269fbf
commit
0ddb1917aa
@ -1649,6 +1649,9 @@ void MB_Destroy()
|
|||||||
|
|
||||||
for (int id=0; id<kNumSyncEvents; id++)
|
for (int id=0; id<kNumSyncEvents; id++)
|
||||||
{
|
{
|
||||||
|
if (g_syncEvent[id] && g_syncEvent[id]->m_active)
|
||||||
|
g_SynchronousEventMgr.Remove(id);
|
||||||
|
|
||||||
delete g_syncEvent[id];
|
delete g_syncEvent[id];
|
||||||
g_syncEvent[id] = NULL;
|
g_syncEvent[id] = NULL;
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,7 @@ public:
|
|||||||
void Initialize(LPBYTE pCxRomPeripheral, UINT uSlot);
|
void Initialize(LPBYTE pCxRomPeripheral, UINT uSlot);
|
||||||
// void Uninitialize();
|
// void Uninitialize();
|
||||||
void Reset();
|
void Reset();
|
||||||
|
UINT GetSlot(void) { return m_uSlot; }
|
||||||
static BYTE __stdcall IORead(WORD PC, WORD uAddr, BYTE bWrite, BYTE uValue, ULONG nExecutedCycles);
|
static BYTE __stdcall IORead(WORD PC, WORD uAddr, BYTE bWrite, BYTE uValue, ULONG nExecutedCycles);
|
||||||
static BYTE __stdcall IOWrite(WORD PC, WORD uAddr, BYTE bWrite, BYTE uValue, ULONG nExecutedCycles);
|
static BYTE __stdcall IOWrite(WORD PC, WORD uAddr, BYTE bWrite, BYTE uValue, ULONG nExecutedCycles);
|
||||||
|
|
||||||
|
@ -653,19 +653,23 @@ int APIENTRY WinMain(HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int)
|
|||||||
MB_Reset();
|
MB_Reset();
|
||||||
LogFileOutput("Main: MB_Reset()\n");
|
LogFileOutput("Main: MB_Reset()\n");
|
||||||
|
|
||||||
CMouseInterface* pMouseCard = GetCardMgr().GetMouseCard();
|
if (g_bRestart)
|
||||||
if (pMouseCard)
|
|
||||||
{
|
{
|
||||||
pMouseCard->Reset(); // Deassert any pending IRQs - GH#514
|
CMouseInterface* pMouseCard = GetCardMgr().GetMouseCard();
|
||||||
LogFileOutput("Main: CMouseInterface::Uninitialize()\n");
|
if (pMouseCard)
|
||||||
|
{
|
||||||
|
// dtor removes event from g_SynchronousEventMgr - do before g_SynchronousEventMgr.Reset()
|
||||||
|
GetCardMgr().Remove( pMouseCard->GetSlot() );
|
||||||
|
LogFileOutput("Main: CMouseInterface::dtor\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
_ASSERT(g_SynchronousEventMgr.GetHead() == NULL);
|
||||||
|
g_SynchronousEventMgr.Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
DSUninit();
|
DSUninit();
|
||||||
LogFileOutput("Main: DSUninit()\n");
|
LogFileOutput("Main: DSUninit()\n");
|
||||||
|
|
||||||
if (g_bRestart)
|
|
||||||
g_SynchronousEventMgr.Reset();
|
|
||||||
|
|
||||||
if (g_bHookSystemKey)
|
if (g_bHookSystemKey)
|
||||||
{
|
{
|
||||||
UninitHookThread();
|
UninitHookThread();
|
||||||
|
Loading…
Reference in New Issue
Block a user