On 13.12.2017 11:11, Josef Reidinger wrote:
In fact it does not help always. E.g. now with libstorage-ng is there autoptr, but still we get segfaults when device graph is changed as these autoptr is set to NULL and create segfaults.
Sure, if a library is used wrong, you can still get a lot of nasty errors. If you store pointers that you don't own, their content can always become invalid if you don't watch out for their lifetime. For C++ code that I write, I always try to document the expected lifetime of pointers that are returned, and of course also who owns that object and who is consequently responsible for deleting it. This is a class of problems that languages using garbage collection (not only Ruby, but also Java, JavaScript and many more) don't have (unless you have circular dependencies where object instances refer to each other, even though there is no more outside reference to any of them anymore; this is hard to detect). Kind regards -- Stefan Hundhammer <shundhammer@suse.de> YaST Developer SUSE Linux GmbH GF: Felix Imendörffer, Jane Smithard, Graham Norton; HRB 21284 (AG Nürnberg) Maxfeldstr. 5, 90409 Nürnberg, Germany -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org