From: Mark H. <mar...@bt...> - 2007-09-15 22:03:16
|
Hi Vidar >> Maybe someone who is more of an OCF expert may be able to help me with > this one? > > This may have something to do with the lack of replies. :-) Yes I was hoping someone else might be using OCF. It does actually broadly seem to work apart from this quite serious issue. > Your fix is probably sufficient. It may even be the best and most > compatible > solution if code already depends on EnabledFlags using TCHAR. But ideally > EnabledFlags shouldn't use TCHAR. It is not an array of characters. It > should be changed to an int (an int8 if space is an issue). > Then again, as far as I can understand the code, the whole implementation > has problems. 128 activations causes an entry in the list to be disabled > due > to overflow. Since there's no Deactivate, i.e. no decrement, I see no > point > in using an incrementing flag. Why not: > > enum Status {Disabled, Enabled, Activated}; > std::vector <Status> StatusList; // replaces EnabledList I was just trying to maintain compatibility really with my fix. However, since it basically doesn't work at all in Unicode I don't see this as being very necessary. Your idea for a simple emumumeration would certainly make the code a lot simpler and as you say there is no real reason for an incrementing flag. >> [OCF Server crash] I have tracked it down to the "Creator" member of > TAppDescriptor. [...] This causes the crash. I'm not sure what the best > plan > is to solve this as there seems no easy place to set Creator to NULL due > to > the way it is deleted through delegation. > > The obvious problem is that Creator is deleted despite having a reference > to > it (in TAppDescriptor). This is the kind of problem that reference-counted > pointers (smart pointers) solve. But I don't have the OCF source installed > so I'm probably of little help here. Yes, I've basically worked out the problem. Just not really sure of the best way to fix it. I will have another think. If anyone else has any ideas please let me know. Thanks,. Mark |