どうやらEnemy_Kikibongoのデストラクタが呼ばれていないようなのです
ListはCObject*型になっています
class CObject{
protected:
bool used;
int obj_ID;
float priority;
public:
CObject(int ID,float priority=0.5f);
virtual ~CObject(){}
virtual void Move()=0;
virtual void Draw()=0;
bool operator <(const CObject *obj)const{
return this->priority < obj->priority;
}
inline bool operator >(const CObject *obj)const{
return this->priority > obj->priority;
}
float GetPriority(){
return this->priority;
}
int GetID();
friend bool Remove_Judge(const CObject *obj);
friend bool Obj_Comp(const CObject *obj1,const CObject *obj2);
};
class EnemyEx :public CObject{
protected:
int cnt;
int HP;
int MaxHP;
float x, y;
float a, sp;
public:
EnemyEx(float x,float y,float a,float sp):CObject(O_ENEMY,0.3){
this->x=x;
this->y=y;
this->a=a;
this->sp=sp;
this->cnt=0;
};
virtual ~EnemyEx(){}
float GetX(){
return this->x;
}
float GetY(){
return this->y;
}
virtual void Damage(int value)=0;
virtual void Move()=0;
virtual void Draw()=0;
};
class Enemy_Kikibongo :public EnemyEx{
int stop_time, restart_time;
float Update_Angle;
int state;
public:
Enemy_Kikibongo(float x,float y,float a,float sp,int stop_time,int restart_time,float Update_Angle)
:EnemyEx(x,y,a,sp){
this->stop_time=stop_time;
this->restart_time=restart_time;
this->Update_Angle=Update_Angle;
this->state=0;
this->MaxHP=100;
this->HP=100;
}
~Enemy_Kikibongo(){
Score+=100;
delete this;
}
void Damage(int value);
void Move();
void Draw();
};
void Object_Manager::MoveTask(){
for(auto itr = List.begin(),end =List.end();itr!=end;itr++){
(*itr)->Move();
}
List.remove_if(Remove_Judge);
}
どうやったらデストラクタが呼ばれるようになるでしょうか…