Skip to content

Commit

Permalink
Incorrect return value from VerifyConnectivity
Browse files Browse the repository at this point in the history
  • Loading branch information
garydan42 committed Dec 18, 2024
1 parent c8a99ce commit aef906e
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions src/api/Transport/MidiSrvTransport/Midi2.MidiSrvSessionTracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ CMidi2MidiSrvSessionTracker::Initialize()
TraceLoggingPointer(this, "this")
);

std::unique_ptr<CMidi2MidiSrv> midiSrv(new (std::nothrow) CMidi2MidiSrv());
RETURN_IF_NULL_ALLOC(midiSrv);

RETURN_IF_FAILED(midiSrv->Initialize());
std::unique_ptr<CMidi2MidiSrv> midiSrv(new (std::nothrow) CMidi2MidiSrv());
RETURN_IF_NULL_ALLOC(midiSrv);

RETURN_IF_FAILED(midiSrv->Initialize());
m_MidiSrv = std::move(midiSrv);

return S_OK;
Expand All @@ -43,8 +43,8 @@ CMidi2MidiSrvSessionTracker::AddClientSession(
TraceLoggingLevel(WINEVENT_LEVEL_INFO),
TraceLoggingPointer(this, "this")
);

RETURN_HR_IF_NULL(CO_E_NOTINITIALIZED, m_MidiSrv);

RETURN_HR_IF_NULL(CO_E_NOTINITIALIZED, m_MidiSrv);
return m_MidiSrv->AddClientSession(sessionId, sessionName);
}

Expand All @@ -63,7 +63,7 @@ CMidi2MidiSrvSessionTracker::UpdateClientSessionName(
TraceLoggingPointer(this, "this")
);

RETURN_HR_IF_NULL(CO_E_NOTINITIALIZED, m_MidiSrv);
RETURN_HR_IF_NULL(CO_E_NOTINITIALIZED, m_MidiSrv);
return m_MidiSrv->UpdateClientSessionName(sessionId, sessionName);
}

Expand All @@ -81,8 +81,8 @@ CMidi2MidiSrvSessionTracker::RemoveClientSession(
TraceLoggingLevel(WINEVENT_LEVEL_INFO),
TraceLoggingPointer(this, "this")
);

RETURN_HR_IF_NULL(CO_E_NOTINITIALIZED, m_MidiSrv);

RETURN_HR_IF_NULL(CO_E_NOTINITIALIZED, m_MidiSrv);
return m_MidiSrv->RemoveClientSession(sessionId);
}

Expand All @@ -100,10 +100,10 @@ CMidi2MidiSrvSessionTracker::GetSessionList(
TraceLoggingPointer(this, "this")
);

RETURN_HR_IF_NULL(CO_E_NOTINITIALIZED, m_MidiSrv);
RETURN_HR_IF_NULL(CO_E_NOTINITIALIZED, m_MidiSrv);
return m_MidiSrv->GetSessionList(sessionList);
}


BOOL
CMidi2MidiSrvSessionTracker::VerifyConnectivity()
{
Expand All @@ -115,9 +115,8 @@ CMidi2MidiSrvSessionTracker::VerifyConnectivity()
TraceLoggingPointer(this, "this")
);

RETURN_HR_IF_NULL(CO_E_NOTINITIALIZED, m_MidiSrv);
return m_MidiSrv->VerifyConnectivity();
}
return m_MidiSrv?m_MidiSrv->VerifyConnectivity():FALSE;
}

HRESULT
CMidi2MidiSrvSessionTracker::Shutdown()
Expand All @@ -138,4 +137,4 @@ CMidi2MidiSrvSessionTracker::Shutdown()

return S_OK;
}


0 comments on commit aef906e

Please sign in to comment.