[Cs3] CS3 Abstract Factory

Mikhail Nesterenko mikhail at cs.kent.edu
Fri Apr 1 00:26:55 EDT 2022


> I was looking at the guiFactoy.cpp example code and was wondering how we
> would go about to destruct the dynamic memory that was allocated in the
> program.
> 

Well, the factory just creates objects. It is the client's
responsibility to destroy them. 

BTW, later in the course, we will be looking at C++ constructs that
keep track of how many pointers are pointing at a dynamically
allocating object and destroying the object when none are. The
constructs are called "smart pointers".

Thanks,
-- 
Mikhail


More information about the cs3 mailing list