[MeeGo-touch-dev] MList takes ownership of cell creator
Zhao, Forrest
forrest.zhao at intel.com
Mon Aug 16 23:29:15 PDT 2010
>>
>> I'm not sure if I fully understand the new approach. The below is
>> the code piece in my application. ...... list = new MList(this);
>> itemCreator = new AlbumItemCreator();
>> list->setCellCreator(itemCreator);
>> model = new AlbumsListModel(nmmPerformer);
>> list->setItemModel(model);
>> listLayout->addItem(list);
>> ......
>>
>> What do I need to change to adapt to the new approach?
>
> Nothing. However most probably you have memory leak. itemCreator is
> not deleted by MList yet. After we merge a patch MList will delete
> your itemCreator when you delete MList.
>
Hehe, itemCreator is deleted in my class destructor :) However when it's deleted by MList I need to remove this line of code in my class destructor, otherwise a coredump could be expected.
Thanks,
Forrest
More information about the MeeGo-touch-dev
mailing list