aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/love/love.c
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-05-20 18:25:58 +1000
committerDavid Walter Seikel2014-05-20 18:25:58 +1000
commit315aaabbce6b2db52ff5796708b777b488fd848e (patch)
treeb58c92292cda35e4435b2448d61a654e30580c7d /src/love/love.c
parentClean up the server startup and connection a bit. (diff)
downloadSledjHamr-315aaabbce6b2db52ff5796708b777b488fd848e.zip
SledjHamr-315aaabbce6b2db52ff5796708b777b488fd848e.tar.gz
SledjHamr-315aaabbce6b2db52ff5796708b777b488fd848e.tar.bz2
SledjHamr-315aaabbce6b2db52ff5796708b777b488fd848e.tar.xz
The results of a session with valgrind.
I'm surprised that this highly experimental code, built with chewing gum and chicken wire, had so little problems, and most of those where leaks. The majority of problems reported are from external libraries.
Diffstat (limited to '')
-rw-r--r--src/love/love.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/love/love.c b/src/love/love.c
index 91c9d95..0e4ac40 100644
--- a/src/love/love.c
+++ b/src/love/love.c
@@ -142,6 +142,9 @@ static void dirList_compile(const char *name, const char *path, void *data)
142 { 142 {
143 if (0 == strcmp(ext, ".lsl")) 143 if (0 == strcmp(ext, ".lsl"))
144 { 144 {
145 // TODO - We are leaking these, coz we don't know when scripts get deleted in the script server.
146 // On the other hand, the main use for this is a temporary hack that sends events to all scripts.
147 // So that part will get a rewrite when we make it real later anyway.
145 script *me = calloc(1, sizeof(script)); 148 script *me = calloc(1, sizeof(script));
146 149
147 scriptCount++; 150 scriptCount++;
@@ -388,6 +391,7 @@ static Eina_Bool _dataLuaSL(void *data, int type, Ecore_Con_Event_Server_Data *e
388 { 391 {
389 sendForth(ourGlobals->serverLuaSL, me->SID, "events.link_message%s", &command[15]); 392 sendForth(ourGlobals->serverLuaSL, me->SID, "events.link_message%s", &command[15]);
390 } 393 }
394 eina_iterator_free(scripts);
391 } 395 }
392 else if (0 == strncmp(command, "llGetNotecardLine(", 18)) 396 else if (0 == strncmp(command, "llGetNotecardLine(", 18))
393 { 397 {
@@ -421,6 +425,7 @@ static Eina_Bool _dataLuaSL(void *data, int type, Ecore_Con_Event_Server_Data *e
421 temp = NULL; 425 temp = NULL;
422 do 426 do
423 { 427 {
428 free(temp);
424 temp = get_rawline(fd, &len, '\n'); 429 temp = get_rawline(fd, &len, '\n');
425 if (temp) 430 if (temp)
426 { 431 {
@@ -455,6 +460,8 @@ static Eina_Bool _dataLuaSL(void *data, int type, Ecore_Con_Event_Server_Data *e
455 else 460 else
456 sendForth(ourGlobals->serverLuaSL, me->SID, "events.dataserver(\"%s\", \"EndOfFuckingAround\")", key); 461 sendForth(ourGlobals->serverLuaSL, me->SID, "events.dataserver(\"%s\", \"EndOfFuckingAround\")", key);
457 } 462 }
463 eina_iterator_free(scripts);
464 free(temp);
458 465
459 close(fd); 466 close(fd);
460 } 467 }
@@ -545,6 +552,7 @@ static Eina_Bool _dataClient(void *data, int type, Ecore_Con_Event_Client_Data *
545 sendForth(ourGlobals->serverLuaSL, me->SID, "events.detectedNames({\"%s\"})", ownerName); 552 sendForth(ourGlobals->serverLuaSL, me->SID, "events.detectedNames({\"%s\"})", ownerName);
546 sendForth(ourGlobals->serverLuaSL, me->SID, "events.touch_start(1)"); 553 sendForth(ourGlobals->serverLuaSL, me->SID, "events.touch_start(1)");
547 } 554 }
555 eina_iterator_free(scripts);
548 } 556 }
549 else if (0 == strncmp(command, "events.listen(", 14)) 557 else if (0 == strncmp(command, "events.listen(", 14))
550 { 558 {
@@ -557,6 +565,7 @@ static Eina_Bool _dataClient(void *data, int type, Ecore_Con_Event_Client_Data *
557 { 565 {
558 sendForth(ourGlobals->serverLuaSL, me->SID, command); 566 sendForth(ourGlobals->serverLuaSL, me->SID, command);
559 } 567 }
568 eina_iterator_free(scripts);
560 } 569 }
561 else 570 else
562 PW("Unknown command from client - %s", command); 571 PW("Unknown command from client - %s", command);
@@ -768,6 +777,8 @@ int main(int argc, char **argv)
768 } 777 }
769 else 778 else
770 PC("Failed to init ecore_con!"); 779 PC("Failed to init ecore_con!");
780
781 eina_hash_free(ourGlobals.scripts);
771 } 782 }
772 else 783 else
773 fprintf(stderr, "Failed to init eina!"); 784 fprintf(stderr, "Failed to init eina!");