From 12dc58a5250adcd13b7b101355cc35a57b97ce3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Mon, 24 Feb 2020 20:34:06 +0100 Subject: [PATCH] Version19.131.1 --- swad_API.c | 19 +++++++++++++++---- swad_changelog.h | 3 ++- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/swad_API.c b/swad_API.c index 3a4f36397..2267577d0 100644 --- a/swad_API.c +++ b/swad_API.c @@ -206,6 +206,7 @@ static const API_Role_t API_RolRole_to_SvcRole[Rol_NUM_ROLES] = /*****************************************************************************/ static void API_Set_gSOAP_RuntimeEnv (struct soap *soap); +static void API_FreeSoapContext (struct soap *soap); static int API_GetPlgCodFromAppKey (struct soap *soap, const char *appKey); @@ -299,8 +300,7 @@ void API_WebService (void) { soap_serve (soap); - soap_end (soap); // Clean up and remove deserialized data - soap_free (soap); // Detach and free runtime context + API_FreeSoapContext (soap); } } @@ -320,13 +320,24 @@ void API_Exit (const char *DetailErrorMessage) DetailErrorMessage) : 0); - soap_end (soap); // Clean up and remove deserialized data - soap_free (soap); // Detach and free runtime context + API_FreeSoapContext (soap); } exit (ReturnCode); } +/*****************************************************************************/ +/****************************** Free SOAP context ****************************/ +/*****************************************************************************/ + +static void API_FreeSoapContext (struct soap *soap) + { + soap_destroy (soap); // delete managed C++ objects + soap_end (soap); // delete managed memory + soap_free (soap); // free the context + API_Set_gSOAP_RuntimeEnv (NULL); // set pointer to NULL in order to not try to free the context again + } + /*****************************************************************************/ /****** Check if the application key of the requester of a web service *******/ /****** is one of the application keys allowed in the plugins *******/ diff --git a/swad_changelog.h b/swad_changelog.h index ccbf64981..b08e803cc 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -497,7 +497,7 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - * En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 19.131 (2020-02-24)" +#define Log_PLATFORM_VERSION "SWAD 19.131.1 (2020-02-24)" #define CSS_FILE "swad19.118.css" #define JS_FILE "swad19.91.1.js" /* @@ -524,6 +524,7 @@ Param // TODO: Si el alumno ha marcado "Permitir que los profesores...", entonces pedir confirmación al pulsar el botón azul, para evitar que se envíe por error antes de tiempo // TODO: Fig_GetAndShowCourseProgramStats + Version 19.131.1: Feb 24, 2020 Fixed bug in API. (281360 lines) Version 19.131: Feb 24, 2020 Code refactoring in API. (281350 lines) Version 19.130.2: Feb 24, 2020 Fixed bugs in usage report. (281259 lines) Version 19.130.1: Feb 24, 2020 Fixed bugs related to database. (281259 lines)