fix memory leak
This commit is contained in:
parent
0cbff9878e
commit
2c7cd2e83c
3 changed files with 10 additions and 7 deletions
|
|
@ -325,10 +325,5 @@ impl ToTokens for RmcProtocolData{
|
|||
self.generate_raw_trait(tokens);
|
||||
self.generate_raw_info(tokens);
|
||||
self.generate_raw_remote_trait(tokens);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -50,7 +50,7 @@ impl MatchmakeManager{
|
|||
async fn garbage_collect(&self){
|
||||
info!("running rnex garbage collector over all sessions and users");
|
||||
|
||||
let idx = 0;
|
||||
let mut idx = 0;
|
||||
|
||||
let mut to_be_deleted_gids = Vec::new();
|
||||
|
||||
|
|
@ -69,6 +69,8 @@ impl MatchmakeManager{
|
|||
if !session.is_reachable(){
|
||||
to_be_deleted_gids.push(gid);
|
||||
}
|
||||
|
||||
idx += 1;
|
||||
}
|
||||
|
||||
let mut sessions = self.sessions.write().await;
|
||||
|
|
|
|||
|
|
@ -269,6 +269,12 @@ impl MatchmakeExtension for User {
|
|||
let session = self.matchmake_manager.get_session(join_session_param.gid).await?;
|
||||
|
||||
let mut session = session.lock().await;
|
||||
|
||||
if session.session.user_password_enabled{
|
||||
if join_session_param.user_password != session.session.user_password{
|
||||
return Err(ErrorCode::RendezVous_InvalidPassword)
|
||||
}
|
||||
}
|
||||
|
||||
session.connected_players.retain(|v| v.upgrade().is_some_and(|v| v.pid != self.pid));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue