MCPcopy Create free account
hub / github.com/JACoders/OpenJK / Cmd_RemoveCommand

Function Cmd_RemoveCommand

code/qcommon/cmd.cpp:648–668  ·  view source on GitHub ↗

============ Cmd_RemoveCommand ============ */

Source from the content-addressed store, hash-verified

646============
647*/
648void Cmd_RemoveCommand( const char *cmd_name ) {
649 cmd_function_t *cmd, **back;
650
651 back = &cmd_functions;
652 while( 1 ) {
653 cmd = *back;
654 if ( !cmd ) {
655 // command wasn't active
656 return;
657 }
658 if ( !strcmp( cmd_name, cmd->name ) ) {
659 *back = cmd->next;
660 if (cmd->name) {
661 Z_Free(cmd->name);
662 }
663 Z_Free (cmd);
664 return;
665 }
666 back = &cmd->next;
667 }
668}
669
670/*
671============

Callers 6

FS_ShutdownFunction · 0.70
Com_ShutdownZoneMemoryFunction · 0.70
WIN_ShutdownFunction · 0.50
snd_dma.cppFile · 0.50
CL_ShutdownFunction · 0.50

Calls 1

Z_FreeFunction · 0.70

Tested by

no test coverage detected