added option for window icon file to run-time special edition support
[rocksndiamonds.git] / src / libgame / misc.c
index c02d392067f81401ad910a666f72da1eb9e196f8..660f4df6a80ee83a2a4cfc9733514b1c126f5cf2 100644 (file)
@@ -1073,6 +1073,9 @@ void Error(int mode, char *format, ...)
   static boolean last_line_was_separator = FALSE;
   char *process_name = "";
 
+  if (program.error_file == NULL)
+    return;
+
 #if defined(PLATFORM_ANDROID)
   android_log_prio = (mode & ERR_DEBUG ? ANDROID_LOG_DEBUG :
                      mode & ERR_INFO ? ANDROID_LOG_INFO :
@@ -1965,6 +1968,10 @@ void addNodeToList(ListNode **node_first, char *key, void *content)
   node_new->key = getStringCopy(key);
   node_new->content = content;
   node_new->next = *node_first;
+
+  if (*node_first)
+    (*node_first)->prev = node_new;
+
   *node_first = node_new;
 }
 
@@ -1977,8 +1984,15 @@ void deleteNodeFromList(ListNode **node_first, char *key,
   if (strEqual((*node_first)->key, key))
   {
     checked_free((*node_first)->key);
+
     if (destructor_function)
       destructor_function((*node_first)->content);
+
+    if ((*node_first)->next)
+      (*node_first)->next->prev = (*node_first)->prev;
+
+    checked_free(*node_first);
+
     *node_first = (*node_first)->next;
   }
   else