Page MenuHomePhabricator

elementary: Check for valid object before calling smart calculate
AbandonedPublic

Authored by devilhorns on Jul 31 2018, 1:32 AM.

Details

Summary

Small patch fixes an issue where evas_object_smart_calculate was being
called with a NULL box.

ref T7030

Depends on D6702

Diff Detail

Repository
rEFL core/efl
Branch
devs/devilhorns/T7030
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 7121
devilhorns created this revision.Jul 31 2018, 1:32 AM

It seems that this patch has no reviewers specified. If you are unsure who can review your patch, please check this wiki page and see if anyone can be added: https://phab.enlightenment.org/w/maintainers_reviewers/

zmike added a comment.Jul 31 2018, 8:30 AM

I think this is another case where the object is invalidated...can you check this and either return from the function immediately on invalidate or avoid the call altogether?

devilhorns updated this revision to Diff 15997.EditedJul 31 2018, 9:46 AM
devilhorns retitled this revision from elementary: Don't call smart_calculate with a NULL box to elementary: Check for valid object before calling smart calculate.
devilhorns edited the summary of this revision. (Show Details)

modified to use efl_invalidated_get

Okay, but is this the earliest point at which the error can be avoided, or is there a place higher up the stack triggering this sizing_eval which can be avoided?

Looking at the backtrace, I think this is the best place

According to the backtrace, the call is happening during construction, not during deletion. Checking invalidated in this case will have no effect, as the object is not invalidated; efl_finalized_get would be what fixes this I think.

devilhorns abandoned this revision.Jul 31 2018, 12:21 PM

Abandon this one as the changes got pushed into D6710

We could have a helper, like efl_is_alive(Eo *obj) return efl_finalized(obj) && !efl_invalidated_get(obj);

zmike added a comment.Aug 1 2018, 6:51 AM

We could have a helper, like efl_is_alive(Eo *obj) return efl_finalized(obj) && !efl_invalidated_get(obj);

I like this idea, but it should also return whether the object is currently invalidating I think.