Page MenuHomePhabricator

elementary: unref objects when memory allocation fails in factory
ClosedPublic

Authored by Jaehyun_Cho on Mon, Sep 16, 3:48 AM.

Details

Summary

The objects referenced are unreferenced when memory allocation fails in
elementary factory.

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.
Jaehyun_Cho created this revision.Mon, Sep 16, 3:48 AM
Jaehyun_Cho requested review of this revision.Mon, Sep 16, 3:48 AM

rename the error name

fixing memory leak in efl_ui_widget_factory.c is included

Jaehyun_Cho retitled this revision from efl_ui_caching_factory: fix memory leak to elementary: fix memory leak in factory.Mon, Sep 16, 4:19 AM
cedric requested changes to this revision.Mon, Sep 16, 7:44 AM

Good catch, but I don't think we need to keep that array for the lifetime of the future and it could maybe be free right after the call to future all. Could you check?

This revision now requires changes to proceed.Mon, Sep 16, 7:44 AM

Fixed not to keep array and rebased

Jaehyun_Cho retitled this revision from elementary: fix memory leak in factory to elementary: unref objects when memory allocation fails in factory.Tue, Sep 17, 6:06 PM
Jaehyun_Cho edited the summary of this revision. (Show Details)
Jaehyun_Cho added a reviewer: devilhorns.
bu5hm4n requested changes to this revision.Wed, Sep 18, 9:11 AM
bu5hm4n added a subscriber: bu5hm4n.
bu5hm4n added inline comments.
src/lib/elementary/efl_ui_caching_factory.c
202

this is leaking the iterator.

212

this is leaking the iterator.

src/lib/elementary/efl_ui_widget_factory.c
204

this is leaking the iterator.

213

this is leaking the iterator.

This revision now requires changes to proceed.Wed, Sep 18, 9:11 AM

free iterator

Is it ok if this is submitted?

bu5hm4n accepted this revision.Mon, Sep 23, 5:15 AM
This revision was not accepted when it landed; it landed in state Needs Review.Mon, Sep 23, 5:16 AM
Closed by commit rEFL98c2a75bda3f: elementary: unref objects when memory allocation fails in factory (authored by Jaehyun_Cho, committed by Marcel Hollerbach <mail@marcel-hollerbach.de>). · Explain Why
This revision was automatically updated to reflect the committed changes.