2

I'm developing an opengl ES 2.0 live wallpaper. Normaly, when an engine is destroyed, its methods onSurfaceDestroyed and onDestroy were called. I notice that when i click on 'Set wallpaper' button, onSurfaceDestroyed and onDestroy are not called.

enter image description here

This methods are usefull to destroy opengl ES contexts. Every time wallpaper switch between normal and preview mode the wallpaper crash due to the resource leak. Is anybody had the same problem?

genpfault
  • 51,148
  • 11
  • 85
  • 139
xcesco
  • 4,690
  • 4
  • 34
  • 65

1 Answers1

1

I'm pretty sure I've figured it out for anyone else having this problem.

It seems that when I already have wallpaper running, then I click 'Set wallpaper' on its preview, the onDestroy() method isn't called. However, nullifying Bitmaps and calling stopSelf() can be put in the onSurfaceDestroyed method, this seems to work for each instance of the WallpaperService Engine open. It might not be the correct way to do things but it seems to work ok at the moment.

Guru Charan
  • 94
  • 1
  • 1
  • 11