2
0
Эх сурвалжийг харах

* fix memory leak of video unit as proposed by Michael Karst, resolves #22876

git-svn-id: trunk@22927 -
florian 12 жил өмнө
parent
commit
b58273fdeb

+ 1 - 0
.gitattributes

@@ -12954,6 +12954,7 @@ tests/webtbs/tw2280.pp svneol=native#text/plain
 tests/webtbs/tw22860.pp svneol=native#text/plain
 tests/webtbs/tw22864.pp svneol=native#text/pascal
 tests/webtbs/tw22869.pp svneol=native#text/plain
+tests/webtbs/tw22876.pp svneol=native#text/pascal
 tests/webtbs/tw22878.pp svneol=native#text/plain
 tests/webtbs/tw2289.pp svneol=native#text/plain
 tests/webtbs/tw2291.pp svneol=native#text/plain

+ 9 - 0
rtl/win/video.pp

@@ -746,4 +746,13 @@ end;
 initialization
   SetVideoDriver(SysVideoDriver);
   TargetEntry;
+
+finalization
+  if (OrigScreenSize <> 0) and (OrigScreen <> nil) then
+    begin
+      FreeMem (OrigScreen, OrigScreenSize);
+      OrigScreen := nil;
+      OrigScreenSize := 0;
+    end;
+
 end.

+ 6 - 0
tests/webtbs/tw22876.pp

@@ -0,0 +1,6 @@
+{ %OPT=-gh }
+program test;
+uses video;
+
+begin
+end.