spu: fix saving bug
[pcsx_rearmed.git] / plugins / gpu-gles / gpuTexture.c
index c5fa2be..2f96482 100644 (file)
@@ -472,6 +472,9 @@ void CheckTextureMemory(void)
    return;\r
   }\r
 \r
+#if 1\r
+ iSortTexCnt=MAXSORTTEX;\r
+#else // below vram detector supposedly crashes some drivers\r
 \r
         iTSize=256;\r
  p=(char *)malloc(iTSize*iTSize*4);\r
@@ -508,6 +511,7 @@ void CheckTextureMemory(void)
  else  iSortTexCnt=iCnt-3+min(1,0);       // place for menu&texwnd\r
 \r
  if(iSortTexCnt<8) iSortTexCnt=8;\r
+#endif\r
 } \r
 \r
 ////////////////////////////////////////////////////////////////////////\r
@@ -608,6 +612,7 @@ void CleanupTextureStore()
   for(j=0;j<MAXTPAGES;j++)                           // loop tex pages\r
    {\r
     free(pscSubtexStore[i][j]);                      // -> clean mem\r
+    pscSubtexStore[i][j]=0;\r
    }\r
  for(i=0;i<MAXSORTTEX;i++)\r
   {\r
@@ -618,6 +623,7 @@ void CleanupTextureStore()
      uiStexturePage[i]=0;                            // --> delete it\r
     }\r
    free(pxSsubtexLeft[i]);                           // -> clean mem\r
+   pxSsubtexLeft[i]=0;\r
   }\r
  //----------------------------------------------------//\r
 }\r