]> Devoid-pointer.net GitWeb - Nine-Q.git/commitdiff
Destroy Cairo objects to prevent memory leaks
authorMichal Malý <madcatxster@devoid-pointer.net>
Sun, 28 Dec 2014 23:42:18 +0000 (00:42 +0100)
committerMichal Malý <madcatxster@devoid-pointer.net>
Sun, 28 Dec 2014 23:42:18 +0000 (00:42 +0100)
bin/nine_q_config.ini
src/problem_generators/problem_generator-titration_curve_suite.adb

index f5aa0ef41c2e1f7c51839ef3e124e1613cbaf4f0..f767ac34854dbbc98832d5e85247e989ed118d1b 100644 (file)
@@ -1,5 +1,5 @@
 Server_Port 18400
-Max_Connection 1000
+Max_Connection 50
 
 Session True
 Session_Lifetime 1800.0
index 32f4c523b077259bce3a961c1591882962fc39c6..4034a354d6202042159e6a839b71276adbd127d3 100644 (file)
@@ -7,6 +7,7 @@ with Ada.Strings.Unbounded;
 with Formatting_Helpers;
 with Cairo.Png;
 with Cairo.Image_Surface;
+with Cairo.Surface;
 with Glib;
 with Interfaces.C;
 with Interfaces.C.Strings;
@@ -184,6 +185,8 @@ package body Titration_Curve_Suite is
     FillIns.Insert(FILLIN_5_VOL_KEY, Answer.Element(ANSWER_VOLUME_SECOND_EQUIV_KEY));
     FillIns.Insert(FILLIN_6_VOL_KEY, Answer.Element(ANSWER_VOLUME_OVER_SECOND_EQUIV_KEY));
 
+    Cairo.Surface.Destroy(Surface);
+    Cairo.Destroy(Ctx);
     return Correct_Answer;
   end Check_Answer;