Project

General

Profile

« Previous | Next » 

Revision 05ecc6fe

Added by Leszek Koltunski about 7 years ago

Major:

1) in the Library, fix the fact that some applications (those that were creating their DistortedSurface objects outside of onSurfaceCreated or onSurfaceChanged) would not render after the activity went to background (press POWER to see that).
2) in the Apps, call the new 'Distorted.onPause()' API to fix the above problem

The above fixes the problem, but it still leaks memory if an App creates its Surface in onSurfaceCreated/Changed (precisely: it leaves the old Surface in the DistortedSurface Map). Thus

3) Fix the first 15 Apps to avoid the memory leak. Next Apps coming.

View differences:

src/main/java/org/distorted/library/DistortedTexture.java
85 85

  
86 86
  void delete()
87 87
    {
88
    if( mColorH[0]>=0 )
88
    if( mColorH[0]>0 )
89 89
      {
90 90
      GLES30.glDeleteTextures(1, mColorH, 0);
91 91
      mColorH[0] = 0;
......
98 98

  
99 99
  void recreate()
100 100
    {
101
    if( mColorCreated!=DONT_CREATE ) mColorCreated = NOT_CREATED_YET;
101
    if( mColorCreated!=DONT_CREATE )
102
      {
103
      mColorCreated = NOT_CREATED_YET;
104
      mColorH[0] = 0;
105
      }
102 106
    }
103 107

  
104 108
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff