From 6a47ab9952693c075f83538d29503db4f7c256b1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michal=20Mal=C3=BD?= Date: Mon, 29 Dec 2014 00:42:18 +0100 Subject: [PATCH] Destroy Cairo objects to prevent memory leaks --- bin/nine_q_config.ini | 2 +- .../problem_generator-titration_curve_suite.adb | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/nine_q_config.ini b/bin/nine_q_config.ini index f5aa0ef..f767ac3 100644 --- a/bin/nine_q_config.ini +++ b/bin/nine_q_config.ini @@ -1,5 +1,5 @@ Server_Port 18400 -Max_Connection 1000 +Max_Connection 50 Session True Session_Lifetime 1800.0 diff --git a/src/problem_generators/problem_generator-titration_curve_suite.adb b/src/problem_generators/problem_generator-titration_curve_suite.adb index 32f4c52..4034a35 100644 --- a/src/problem_generators/problem_generator-titration_curve_suite.adb +++ b/src/problem_generators/problem_generator-titration_curve_suite.adb @@ -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; -- 2.43.5