[Live-devel] delete objects when testMPEG4VideoToDarwin ends

Ross Finlayson finlayson at live.com
Mon Aug 1 15:11:02 PDT 2005


>example: delete injector
>error: virtual DarwinInjector::~DarwinInjector() private
>
>How can I delete the object injector?, and the others
>
>I know it is more a C++ question than a live-devel question

No, it really is a "live-devel" question :-)

To delete objects of classes - like "DarwinInjector" - that are 
subclasses of "Medium", call "Medium::close()" - e.g.
         Medium::close(injector);
(Do the same to delete "videoSink" and "videoRTCP".)

To delete objects of type "UsageEnvironment", call "reclaim()" - e.g.,
         env->reclaim();

To delete objects of type "TaskScheduler", you can just call "delete" - e.g.,
         delete scheduler;

In general, it's a good idea to delete objects in the reverse order 
that they were created.


	Ross Finlayson
	LIVE.COM
	<http://www.live.com/>



More information about the live-devel mailing list