Page MenuHomePhabricator

evas: make objects again delete correctly
ClosedPublic

Authored by bu5hm4n on Jun 14 2018, 11:53 AM.

Details

Summary

what here was done was fundamentally wrong, deleting the pd->object
field of a evas object after a efl_del / evas_object_del is completly
wrong. evas object lifetimes are controller with eo_manual_free, this
means, they are still alive, even after you called evas_object_del on
them. removing pd->object results in eo_menual_free calls to NULL
objects and leaking the object carrying the private data. Overall,
breaking this pd->object field and unsetting it is a very bad idea, as
its the only way that evas cleansup the object correctly.
This brings down the number of ui related leaked objects on shutdowns to
0. (YEY :))
This also fixes weird error messages on app shutdown.

fixes T6964

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bu5hm4n created this revision.Jun 14 2018, 11:53 AM
bu5hm4n requested review of this revision.Jun 14 2018, 11:53 AM

It seems odd to me that this line was included if it's so obviously wrong. Can you speculate about why it was added?

No idea, git blame was a generic "make evas lifetime work with invalidate" commit ... maybe something to prevent use after free which is not true here ?

zmike accepted this revision.Jun 14 2018, 12:14 PM

Could be I guess

This revision is now accepted and ready to land.Jun 14 2018, 12:14 PM
Closed by commit rEFL81519b195f04: evas: make objects again delete correctly (authored by Marcel Hollerbach <mail@marcel-hollerbach.de>, committed by stephenmhouston). · Explain WhyJun 14 2018, 12:24 PM
This revision was automatically updated to reflect the committed changes.