elm fileselector: fix possible premature deletion of Listing_Request struct
authorVitor Sousa <vitorsousasilva@gmail.com>
Wed, 24 Aug 2016 22:43:51 +0000 (19:43 -0300)
committerVitor Sousa <vitorsousasilva@gmail.com>
Fri, 26 Aug 2016 22:45:26 +0000 (19:45 -0300)
commit5d2948b016955410ca8137ec944b8b91b169dc07
treeb0a58041163afaf86a2d919b7af5d7cc2b8d98b7
parent1ab1e3697dc4dfead65fadc02747d876c993f935
elm fileselector: fix possible premature deletion of Listing_Request struct

In a case where eina_promise_then is executed immediately (like with some
quick and light Efl.Model), the Listing_Request struct will be prematurely
freed in the first iteration of the child processing loop, because the
item_total counter had not accumulated the right number of items yet.

With this commit, we traverse the children accessor first, so we can know
the number of items.

Also, no longer use the Listing_Request pointer after the loop, once it
may have been deallocate already.
And put a note about this too.
src/lib/elementary/elc_fileselector.c