does the destructing job properly already.
// along with EmuFront. If not, see <http://www.gnu.org/licenses/>.
#include "emufrontfileobject.h"
// along with EmuFront. If not, see <http://www.gnu.org/licenses/>.
#include "emufrontfileobject.h"
EmuFrontFileObject::EmuFrontFileObject()
: EmuFrontObject(-1, ""), file(0) { }
EmuFrontFileObject::EmuFrontFileObject()
: EmuFrontObject(-1, ""), file(0) { }
EmuFrontFileObject::~EmuFrontFileObject()
{
EmuFrontFileObject::~EmuFrontFileObject()
{
+ qDebug() << "EmuFrontFileObject " << name << " dying";
+ if (file) qDebug() << "File " << file->getName() << " will also be deleted.";
+ delete file;
}
EmuFrontFileObject& EmuFrontFileObject::operator =(const EmuFrontFileObject &ob)
}
EmuFrontFileObject& EmuFrontFileObject::operator =(const EmuFrontFileObject &ob)
if (this == &ob) return (*this);
id = ob.id;
name = ob.name;
if (this == &ob) return (*this);
id = ob.id;
name = ob.name;
EmuFrontFile *f = ob.file;
file = new EmuFrontFile(*f);
return (*this);
EmuFrontFile *f = ob.file;
file = new EmuFrontFile(*f);
return (*this);
: EmuFrontFileObject(p)
{
}
: EmuFrontFileObject(p)
{
}
-
-Platform::~Platform()
-{
- if (file) {
- qDebug() << "file: " << file->getName();
- }
- qDebug() << "Platform " << name << " @ "
- << this << "dying.";
-}
-
Platform(int id, QString name);
Platform(int id, QString name, EmuFrontFile*);
Platform(const Platform &);
Platform(int id, QString name);
Platform(int id, QString name, EmuFrontFile*);
Platform(const Platform &);
// and pointer from p6 would keep pointing to memory area where
// efA no longer exists:
//Platform p6(1, "test", efA);
// and pointer from p6 would keep pointing to memory area where
// efA no longer exists:
//Platform p6(1, "test", efA);
- Platform p6(1, "test", efA);
+ Platform p6(1, "test", efB);
qDebug() << "efA" << efA->getName();
qDebug() << "efB" << efB->getName();
qDebug() << "efA" << efA->getName();
qDebug() << "efB" << efB->getName();
private:
//EmuFrontFile *ef;
/*
private:
//EmuFrontFile *ef;
/*
- EmuFrontFile *efile;
- */
//EmuFrontFile *efA;
//EmuFrontFile *efB;
//EmuFrontFile *efA;
//EmuFrontFile *efB;