Debian Codegraph @

modules/lsp-runtime-lib/src/main/fmt/java/ObjectStreamClass.cpp

raw
1 /*
2 * Copyright (C) 2020 Linux Studio Plugins Project <https://lsp-plug.in/>
3 * (C) 2020 Vladimir Sadovnikov <[email protected]>
4 *
5 * This file is part of lsp-runtime-lib
6 * Created on: 29 авг. 2019 г.
7 *
8 * lsp-runtime-lib is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * any later version.
12 *
13 * lsp-runtime-lib is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with lsp-runtime-lib. If not, see <https://www.gnu.org/licenses/>.
20 */
21
22 #include <lsp-plug.in/fmt/java/defs.h>
23 #include <lsp-plug.in/fmt/java/ObjectStreamClass.h>
24
25 namespace lsp
26 {
27 namespace java
28 {
29 const char *ObjectStreamClass::CLASS_NAME = "java.io.ObjectStreamClass";
30
31 ObjectStreamClass::ObjectStreamClass(): Object(CLASS_NAME)
32 {
33 pParent = NULL;
34 pRawName = NULL;
35 nSuid = 0;
36 nFlags = 0;
37 nFields = 0;
38 nClasses = 0;
39 nSizeOf = 0;
40 vFields = NULL;
41 vClasses = NULL;
42 }
43
44 ObjectStreamClass::~ObjectStreamClass()
45 {
46 if (vFields != NULL)
47 {
48 for (size_t i=0; i<nFields; ++i)
49 {
50 if (vFields[i] != NULL)
51 {
52 delete vFields[i];
53 vFields[i] = NULL;
54 }
55 }
56 ::free(vFields);
57 vFields = NULL;
58 }
59 if (vClasses != NULL)
60 {
61 for (size_t i=0; i<nClasses; ++i)
62 if (vClasses[i] != NULL)
63 vClasses[i] = NULL;
64 ::free(vClasses);
65 vClasses = NULL;
66 }
67 if (pRawName != NULL)
68 {
69 ::free(pRawName);
70 pRawName = NULL;
71 }
72 }
73
74 } /* namespace java */
75 } /* namespace lsp */