/** * @warning If we use it with real option node, i will crash the code cause * relation with parent node are not updated * @param tree Root of nodes we want to delete */ static void UI_DeleteOption (uiNode_t* tree) { while (tree) { uiNode_t* del = tree; tree = tree->next; UI_DeleteNode(del); } }
static void UI_AbstractNodeCallDelete (uiNode_t* node, const uiCallContext_t* context) { if (UI_GetParamNumber(context) != 0) { Com_Printf("UI_AbstractNodeCallDelete: Invalid number of parameters\n"); return; } UI_DeleteNode(node); }
/** * @brief Remove all child from a node (only remove dynamic memory allocation nodes) * @param node The node we want to clean */ void UI_DeleteAllChild (uiNode_t* node) { uiNode_t *child; child = node->firstChild; while (child) { uiNode_t *next = child->next; UI_DeleteNode(child); child = next; } }
static void UI_AbstractNodeCallDeleteTimed (uiNode_t* node, const uiCallContext_t* context) { if (UI_GetParamNumber(context) != 1) { Com_Printf("UI_AbstractNodeCallDeleteTimed: Invalid number of parameters\n"); return; } const char* msStr = UI_GetParam(context, 1); const int ms = atoi(msStr); if (ms <= 0) { UI_DeleteNode(node); } else { node->deleteTime = CL_Milliseconds() + ms; } }