>> IOW you are replacing crashes with leaks.
>> 
>> IMO it would be simpler to just never delete any objects...
>> 
>> Now all these intentional leaks ("persistent objects") 
>> will have to be refixed one by one once ever HBQT gets 
>> fixed in the proper place. This means another (even 
>> lengthier) chain of fixes in the future. Unless all of 
>> these current hacks are clearly marked as such in source.
>> 
> 
> This is exactly what I am doing, locals to class variable.
> OR am I missing something from your message?

You're fixing low-level crashes by introducing 
unnecessary memory consumption, and/or by solving 
"reference counting" manually on the high level.

Both are wrong solutions. They are masking/hiding 
the real problem by introducing unnecessary and/or 
wrong logic in high-level code. Plus they create 
impossible to document and follow high-level 
programming requirements for any HBQT programs.

> If I leave them "as is", next time a new object will be 
> created and will consume another chunk of memory.
> If an object is created once and reused, no harms, 
> even if we fix the root issue. This also prevents memory
> fregmentation.

In this sense the best way to avoid memory fragmentation 
is to never release any memory. In this sense your 
reasoning is right.

All I'm seeing is huge and endless efforts to hide 
very serious low-level errors on the high-level.

I've written about this dozens of times, Przemek 
wrote about it, but the phenomena just continues.

Probably it would be more fruitful method to start 
experimenting with and understanding the basic 
memory/object handling concept of QT using some 
_small_ and _representative_ examples, and create 
a clean wrapper design for these. Then apply this 
logic for all objects covered by HBQT.

[ I understand HBQT is so heavy by now, that such 
experimenting is not very practical on it, hence 
this suggestion. ]

Brgds,
Viktor

_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to