Changeset 164
- Timestamp:
- 1999-02-22T11:33:54+13:00 (25 years ago)
- Location:
- trunk/gsdl/src/recpt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/converter.cpp
r150 r164 12 12 /* 13 13 $Log$ 14 Revision 1.2 1999/02/21 22:33:54 rjmcnab 15 Lots of stuff :-) 16 14 17 Revision 1.1 1999/02/05 10:42:45 rjmcnab 15 18 … … 24 27 25 28 // the converters within converterinfo become the property of 26 // of this class after add_converter has been called. The y should27 // be allocated with new but not explicitly destroyed (they will28 // be destroyed when this class is destroyed).29 // of this class after add_converter has been called. The converters 30 // remain the responsability of the calling code and will not be 31 // deleted by this class. 29 32 void convertinfoclass::add_converter (const text_t &name, inconvertclass *inconverter, 30 33 rzwsoutconvertclass *outconverter) { 31 34 // can't add a null converter or an action with no name 32 35 if (inconverter == NULL || outconverter == NULL || name.empty()) { 33 if (inconverter != NULL) delete inconverter;34 if (outconverter != NULL) delete outconverter;35 36 return; 36 37 } … … 41 42 info.outconverter = outconverter; 42 43 converters[name] = info; 43 info.inconverter = NULL; // ownership has changed44 info.outconverter = NULL; // ownership has changed45 44 } 46 45 -
trunk/gsdl/src/recpt/converter.h
r150 r164 28 28 29 29 30 // inconverter and outconverter ARE NOT destroyed by this class 31 // they should be destroyed by the code which created them after 32 // no more pointers to the class exist. 33 // 34 // The above condition enables the class to be copied without 35 // copying the converters which might contain a lot of data (and 36 // be of an unknown derived type). 30 37 class converterinfo { 31 38 public: … … 35 42 36 43 converterinfo() {inconverter=NULL; outconverter=NULL;} 37 ~converterinfo() {38 if (inconverter!=NULL) {39 delete inconverter;40 inconverter=NULL;41 }42 if (outconverter!=NULL) {43 delete outconverter;44 outconverter=NULL;45 }46 }47 44 }; 48 45 … … 90 87 91 88 // the converters within converterinfo become the property of 92 // of this class after add_converter has been called. The y should93 // be allocated with new but not explicitly destroyed (they will94 // be destroyed when this class is destroyed).89 // of this class after add_converter has been called. The converters 90 // remain the responsability of the calling code and will not be 91 // deleted by this class. 95 92 void add_converter (const text_t &name, inconvertclass *inconverter, 96 93 rzwsoutconvertclass *outconverter);
Note:
See TracChangeset
for help on using the changeset viewer.