You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Your are right, AA should generate a releaseHelper() call in the an onDestroy() type of method.
But it is not easy to implement, because EComponentHolder does not know about this type of methods. @DayS, what are you suggesting? We faced the same problem when i tried to implement @TypedArrayRes, and i could not release the array.
Yes, there is an issue on this. But OrmLiteDao annotation could be in any enhanced classes (ie: EBean, EService, ...). So we can't rely on onDestroy method to release this.
You are right. Maybe in the generator, we could check that EComponentHolder is a "destroyable" thing, and if yes, then generate the release method? And add a JavaDoc that other client is responsible for releasing in other enhanced classes.
It seems that @yDelouis created OrmLite handling. @yDelouis, can you look into this?
Some of them still does not have onDestroy(), so you have to handle this. Namely i think only View and ViewGroup lack that method, but putting a dao in a View is a not a good solution anyway.
What about EBean classes ? In case of singleton there is no issue but for classic bean we should also release the OpenHelperManager instance.
We could generate a onDestroy() method in bean and call this method in every class bean from enhances classes handling this event.
I did read this issue. We can use the same mechanism to release the instance but, of course, we can't rely on the availability of an OnDestroy annotated method in the bean.
You are right, sorry... I guess then we should just leave releasing to the client, and emphasize that in the JavaDoc: "if there is no OnDestroy(), then release won't be called." @EView and @EViewGroup do not have onDestroy(), too, so it would not be a unique case.
@yDelouis I think we could partially solve this issue for @EActivity, @EFragment, @EService and @EIntentService. The others can wait since that need would need bigger features to implement.
I guess it would be worth mentionting that "rebind" method of a EBean should take care of that as well.
In my scenario, my adapter is an EBean which itself has a injected DAO. When the rebind() is being called, Helper is not released.
This is now partially fixed: we now release the helper in @EActivity, @EFragment, @EService and @EIntentService. This problem still persists in enhanced classes where there is no onDestroy method.
Activity
WonderCsabo commentedon Apr 7, 2014
Your are right, AA should generate a
releaseHelper()call in the anonDestroy()type of method.But it is not easy to implement, because
EComponentHolderdoes not know about this type of methods. @DayS, what are you suggesting? We faced the same problem when i tried to implement@TypedArrayRes, and i could not release the array.DayS commentedon Apr 22, 2014
Yes, there is an issue on this. But
OrmLiteDaoannotation could be in any enhanced classes (ie:EBean,EService, ...). So we can't rely ononDestroymethod to release this.WonderCsabo commentedon Apr 22, 2014
You are right. Maybe in the generator, we could check that
EComponentHolderis a "destroyable" thing, and if yes, then generate thereleasemethod? And add a JavaDoc that other client is responsible for releasing in other enhanced classes.It seems that @yDelouis created OrmLite handling. @yDelouis, can you look into this?
yDelouis commentedon Apr 22, 2014
I didn't create OrmLite handling but I can work on this.
This could be done in combination with #843 so that some
EBeanwould be "destroyable" too.WonderCsabo commentedon Apr 22, 2014
Ok great. Our enhanced components are the following:
Some of them still does not have
onDestroy(), so you have to handle this. Namely i think onlyViewandViewGrouplack that method, but putting a dao in a View is a not a good solution anyway.DayS commentedon Apr 22, 2014
What about
EBeanclasses ? In case of singleton there is no issue but for classic bean we should also release theOpenHelperManagerinstance.We could generate a
onDestroy()method in bean and call this method in every class bean from enhances classes handling this event.WonderCsabo commentedon Apr 22, 2014
@DayS are you read the referenced #843 ? That suggestion would make
EBeans destroyable at instance level.DayS commentedon Apr 24, 2014
I did read this issue. We can use the same mechanism to release the instance but, of course, we can't rely on the availability of an
OnDestroyannotated method in the bean.WonderCsabo commentedon Apr 24, 2014
You are right, sorry... I guess then we should just leave releasing to the client, and emphasize that in the JavaDoc: "if there is no OnDestroy(), then release won't be called."
@EViewand@EViewGroupdo not haveonDestroy(), too, so it would not be a unique case.WonderCsabo commentedon Aug 27, 2014
@yDelouis I think we could partially solve this issue for
@EActivity,@EFragment,@EServiceand@EIntentService. The others can wait since that need would need bigger features to implement.1 remaining item
SidhNor commentedon Oct 3, 2014
I guess it would be worth mentionting that "rebind" method of a EBean should take care of that as well.
In my scenario, my adapter is an EBean which itself has a injected DAO. When the rebind() is being called, Helper is not released.
jiongxuan commentedon Nov 14, 2014
I also have the same problems. :)
I agree with @WonderCsabo. We cloud partially solve this issue for
@EActivityand others Annotations with onDestroy method. :)Sounds exciting for "Destroyable"! How did they go? Writing? :)
WonderCsabo commentedon Nov 14, 2014
Feel free to contribute it for
@EActivityand co.For beans, we do not have a clear concept yet.
jiongxuan commentedon Nov 15, 2014
Okay.
Assign to me. I'll try to fix them.
WonderCsabo commentedon Nov 15, 2014
I cannot assign this to you in the GitHub interface, only excilys AA members, but feel to be assigned. :)
jiongxuan commentedon Nov 16, 2014
I created a PR.
Kindly give us your advice, please. :)
WonderCsabo commentedon Nov 20, 2014
This is now partially fixed: we now release the helper in
@EActivity,@EFragment,@EServiceand@EIntentService. This problem still persists in enhanced classes where there is noonDestroymethod.WonderCsabo commentedon Jun 24, 2015
@yDelouis i just realized
@OrmLiteDaois available in all component annotations. I think we should not allow it in@EViewand@EViewGroup. WDYT?yDelouis commentedon Jun 24, 2015
It's quite the same question than removing
Viewsupport from@EBean...WonderCsabo commentedon Jun 24, 2015
On the second thought, we still allow that, because some people are using
Views instead ofFragments.I am closing this issue, because we cannot release the helpers in other components. We can revisit this if we ever implement #843.