Page MenuHomePhabricator

evas_callbacks: make the callback protection a little bit safer
ClosedPublic

Authored by bu5hm4n on Sep 4 2019, 12:25 PM.

Details

Summary

the problem here is that we might subscribe to an event before
evas_object_callbacks_init has happened. This sounds like something
which might not happen. However, with the interfaces project this
definitly will start to happen because someone will some day overwrite
the evas object and do something before the constructor, which will not
raise a error or something but will simply just not work.

With this commit we are not listening to the event callbacks via event
emission but rather via inheritance. With this there is no "earlier than
we listend" point, and the issue in the task is solved by itself.

fix T8202

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.Sep 4 2019, 12:25 PM
bu5hm4n requested review of this revision.Sep 4 2019, 12:25 PM
bu5hm4n updated this revision to Diff 24753.Sep 4 2019, 10:53 PM
bu5hm4n edited the summary of this revision. (Show Details)

completly work with eo inheritance

This looks good provisionally, but I'd like to wait until @cedric is back for another review.

The declarations of evas_object_callback_init() and evas_object_callback_shutdown() in evas_private.h are required to be removed.

Did you use evas_object_callbacks_finalized() not to call _animator_repeater callback until finalized to enhance performance?

bu5hm4n updated this revision to Diff 24887.Sep 10 2019, 6:02 AM

remove not needed declaration

The finalized stuff is needed due to the fact that very early on the object is not placed, so there is no evas available, so i cannot attach the TICK event.

Jaehyun_Cho accepted this revision.Sep 10 2019, 6:57 AM

Thank you. This patch wisely removes the redundant event callbacks. I think it's nice :)

This looks good to me.

@cedric
Could you review this patch? :)

This revision is now accepted and ready to land.Sep 10 2019, 6:57 AM
cedric accepted this revision.Sep 10 2019, 9:48 AM

Looks good and make me wonder if catching events handler through callback is a good strategy.

@cedric i would say 'no' for several reasons, its also questionable performance wise.

Closed by commit rEFL602895289403: evas_callbacks: make the callback protection a little bit safer (authored by Marcel Hollerbach <mail@marcel-hollerbach.de>). · Explain WhySep 11 2019, 1:37 AM
This revision was automatically updated to reflect the committed changes.