Browse Source

fix memory error on finalization (when another theme is selected)

Unknown 6 years ago
parent
commit
c5a2b0dcea
1 changed files with 7 additions and 2 deletions
  1. 7 2
      bgratheme.pas

+ 7 - 2
bgratheme.pas

@@ -119,10 +119,15 @@ begin
   end;
   end;
 end;
 end;
 
 
+var
+  BasicTheme : TBGRATheme;
+
 initialization
 initialization
-  BGRADefaultTheme := TBGRATheme.Create(nil);
+
+  BasicTheme := TBGRATheme.Create(nil);
+  BGRADefaultTheme := BasicTheme;
 
 
 finalization
 finalization
-  FreeAndNil(BGRADefaultTheme);
+  FreeAndNil(BasicTheme);
 
 
 end.
 end.