Commits

Ryan Kistner committed e60538c

boost is crashing on SteamAPI_UnregisterCallback

  • Participants
  • Parent commits 6d22b77

Comments (0)

Files changed (2)

File steam_api/apitest/main.cpp

 class CLobbyBrowser
 {
 public:
+	CLobbyBrowser() : m_CallbackLobbyMatchList( this, &CLobbyBrowser::OnLobbyMatchListCallback ) {};
+
 	CCallResult<CLobbyBrowser, LobbyMatchList_t> m_SteamCallResultLobbyMatchList;
 	void OnLobbyMatchListCallback( LobbyMatchList_t *pLobbyMatchList, bool bIOFailure )
 	{
-		std::cout << "qq " << pLobbyMatchList->m_nLobbiesMatching << std::endl;
+		std::cout << "qq " << pLobbyMatchList->m_nLobbiesMatching << " " << bIOFailure << std::endl;
 	}
+
+	STEAM_CALLBACK( CLobbyBrowser, OnLobbyMatchListCallback, LobbyMatchList_t, m_CallbackLobbyMatchList );
 } qq;
 
+void CLobbyBrowser::OnLobbyMatchListCallback( LobbyMatchList_t *pLobbyMatchList )
+{
+	std::cout << "qq regular callback " << pLobbyMatchList->m_nLobbiesMatching << std::endl;
+}
+
 int main(int argc, char *argv[])
 {
 	SetEnvironmentVariableA("SteamAppId", "500");

File steam_api/callbacks.cpp

 
 void CallbackManager::UnRegisterCallback(CCallbackBase *callback)
 {
-	std::pair<CallbacksMap::iterator, CallbacksMap::iterator> range = callbacks.equal_range( callback->GetICallback() );
+	// send help!
+	int iCallback = callback->GetICallback();
+	std::pair<CallbacksMap::iterator, CallbacksMap::iterator> range = callbacks.equal_range( iCallback );
 
 	CallbacksMap::const_iterator iter = range.first;
 	while(iter != range.second)