Browse Source

--- Merging r22927 into '.':
U rtl/win/video.pp
A tests/webtbs/tw22876.pp

# revisions: 22927
r22927 | florian | 2012-11-04 19:42:47 +0100 (Sun, 04 Nov 2012) | 1 line
Changed paths:
M /trunk/rtl/win/video.pp
A /trunk/tests/webtbs/tw22876.pp

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

git-svn-id: branches/fixes_2_6@24952 -

marco 12 years ago
parent
commit
cc410dc04b
3 changed files with 16 additions and 0 deletions
  1. 1 0
      .gitattributes
  2. 9 0
      rtl/win/video.pp
  3. 6 0
      tests/webtbs/tw22876.pp

+ 1 - 0
.gitattributes

@@ -12029,6 +12029,7 @@ tests/webtbs/tw2274.pp svneol=native#text/plain
 tests/webtbs/tw2277.pp svneol=native#text/plain
 tests/webtbs/tw2280.pp svneol=native#text/plain
 tests/webtbs/tw22869.pp svneol=native#text/plain
+tests/webtbs/tw22876.pp svneol=native#text/pascal
 tests/webtbs/tw2289.pp svneol=native#text/plain
 tests/webtbs/tw2291.pp svneol=native#text/plain
 tests/webtbs/tw2294.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.