Directory: | source/ |
---|---|
File: | source/component_destructor.c |
Date: | 2023-12-18 09:27:49 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 6 | 6 | 100.0% |
Branches: | 2 | 2 | 100.0% |
Line | Branch | Exec | Source |
---|---|---|---|
1 | /* | ||
2 | * Filename: component_destructor.c | ||
3 | * Path: source | ||
4 | * Created Date: Sunday, February 12th 2023, 5:21:14 pm | ||
5 | * Author: osvegn | ||
6 | * | ||
7 | * Copyright (c) 2023 ECS | ||
8 | */ | ||
9 | |||
10 | #include "component.h" | ||
11 | #include "world_logger.h" | ||
12 | #include <stdlib.h> | ||
13 | |||
14 | 4 | void component_destructor(component_t *c) | |
15 | { | ||
16 | 4 | log_info("Component (%d) destructor called", c->type); | |
17 |
2/2✓ Branch 0 taken 1 times.
✓ Branch 1 taken 3 times.
|
4 | if (c->data) |
18 | 1 | free(c->data); | |
19 | 4 | c->data = 0; | |
20 | 4 | } | |
21 |