I have a dll with a class that uses an abstract class for customizing the behaviour and it also has an implementation defined in dll
With this the app allocates a Child object and passes it into the class A
which it deallocates the object when it is deleted
Can deleting an object that is created in the app from the dll create a problem if it does any idea of fixing it
The code roughly translates into this
// Dll
DLLEXPORT class A
{
private:
Base* ptr;
public:
A(Base* ptr) { this->ptr = ptr; };
~A() { delete ptr; }
};
DLLEXPORT class Base
{
virtual int foo() = 0;
};
DLLEXPORT class Child : public Base
{
virtual int foo() { return 1; }
};
// App
int main()
{
A obj(new Child);
return 0;
}