wangyu- 7 年 前
コミット
4b2865cf2e
2 ファイル変更15 行追加7 行削除
  1. 3 2
      connection.h
  2. 12 5
      fec_manager.h

+ 3 - 2
connection.h

@@ -252,7 +252,7 @@ struct stat_t
 };
 
 
-struct conn_info_t     //stores info for a raw connection.for client ,there is only one connection,for server there can be thousand of connection since server can
+struct conn_info_t:not_copy_able_t     //stores info for a raw connection.for client ,there is only one connection,for server there can be thousand of connection since server can
 //handle multiple clients
 {
 	union  tmp_union_t
@@ -325,10 +325,11 @@ struct conn_info_t     //stores info for a raw connection.for client ,there is o
 	{
 		last_active_time=get_current_time();
 	}
+	/*
 	conn_info_t(const conn_info_t &b)
 	{
 		assert(0==1);
-	}
+	}*/
 };
 /*
 struct conn_manager_t  //manager for connections. for client,we dont need conn_manager since there is only one connection.for server we use one conn_manager for all connections

+ 12 - 5
fec_manager.h

@@ -291,7 +291,7 @@ struct blob_decode_t
 	int output(int &n,char ** &output,int *&len_arr);
 };
 
-class fec_encode_manager_t
+class fec_encode_manager_t:not_copy_able_t
 {
 
 private:
@@ -422,10 +422,10 @@ struct fec_group_t
 	//int data_counter=0;
 	map<int,int>  group_mp;
 };
-class fec_decode_manager_t
+class fec_decode_manager_t:not_copy_able_t
 {
 	anti_replay_t anti_replay;
-	fec_data_t *fec_data;
+	fec_data_t *fec_data=0;
 	unordered_map<u32_t, fec_group_t> mp;
 	blob_decode_t blob_decode;
 
@@ -443,15 +443,22 @@ public:
 	fec_decode_manager_t()
 	{
 		fec_data=new fec_data_t[fec_buff_num+5];
+		assert(fec_data!=0);
 		clear();
 	}
+	/*
 	fec_decode_manager_t(const fec_decode_manager_t &b)
 	{
 		assert(0==1);//not allowed to copy
-	}
+	}*/
 	~fec_decode_manager_t()
 	{
-		delete fec_data;
+		mylog(log_debug,"fec_decode_manager destroyed\n");
+		if(fec_data!=0)
+		{
+			mylog(log_debug,"fec_data freed\n");
+			delete fec_data;
+		}
 	}
 	int clear()
 	{