use wrapper to destroy event and result

git-svn-id: svn+ssh://cvs.lpds.sztaki.hu/var/lib/svn/szdg/dcapi/trunk@752 a7169a2c-3604-0410-bc95-c702d8d87f7a
This commit is contained in:
drdani 2006-06-23 07:51:06 +00:00 committed by Adam Visegradi
parent 26450f28bb
commit 45e0204f2a
3 changed files with 14 additions and 19 deletions

View File

@ -19,6 +19,7 @@
#include "condor_wu.h" #include "condor_wu.h"
#include "condor_log.h" #include "condor_log.h"
#include "condor_utils.h" #include "condor_utils.h"
#include "condor_event.h"
/********************************************************************* INIT */ /********************************************************************* INIT */
@ -664,33 +665,17 @@ void
DC_destroyMasterEvent(DC_MasterEvent *event) DC_destroyMasterEvent(DC_MasterEvent *event)
{ {
DC_log(LOG_DEBUG, "DC_destroyMasterEvent(%p)", event); DC_log(LOG_DEBUG, "DC_destroyMasterEvent(%p)", event);
if (!event) _DC_event_destroy(event);
return;
switch (event->type)
{
case DC_MASTER_RESULT:
g_free(event->result);
break;
case DC_MASTER_SUBRESULT:
_DC_destroyPhysicalFile(event->subresult);
break;
case DC_MASTER_MESSAGE:
g_free(event->message);
break;
}
} }
/**************************************************************** Messaging */ /**************************************************************** Messaging */
static int _DC_message_id= 0;
/* Sends a message to a running work unit. */ /* Sends a message to a running work unit. */
int int
DC_sendWUMessage(DC_Workunit *wu, const char *message) DC_sendWUMessage(DC_Workunit *wu, const char *message)
{ {
GString *dn; GString *dn;
FILE *f;
int ret; int ret;
if (!_DC_wu_check(wu)) if (!_DC_wu_check(wu))

View File

@ -6,7 +6,7 @@
DC_Result * DC_Result *
_DC_create_result(DC_Workunit *wu) _DC_result_create(DC_Workunit *wu)
{ {
DC_Result *r; DC_Result *r;
@ -16,4 +16,13 @@ _DC_create_result(DC_Workunit *wu)
} }
void
_DC_result_destroy(DC_Result *result)
{
if (!result)
return;
g_free(result);
}
/* End of condor_result.c */ /* End of condor_result.c */

View File

@ -12,7 +12,8 @@ extern "C" {
#include "condor_defs.h" #include "condor_defs.h"
extern DC_Result *_DC_create_result(DC_Workunit *wu); extern DC_Result *_DC_result_create(DC_Workunit *wu);
extern void _DC_result_destroy(DC_Result *result);
#ifdef __cplusplus #ifdef __cplusplus