Commit 84ff80c
authored
[cpp_api] Update
[SC-53365](https://app.shortcut.com/tiledb-inc/story/53365/cpp-api-invalid-tiledb-object-error-messages-cause-noise)
This PR updates the `Deleter` class do nothing when a null pointer is
passed to it. Previously it would pass the pointer to `tiledb_***_free`,
which would cause an error that gets ignored because most APIs return
`void`, and emit an error log message. This resulted in lots of [noise
in CI
logs](https://github.com/TileDB-Inc/TileDB/actions/runs/10530673714/job/29181096416?pr=5255#step:14:2728).
There are some cases in the C++ API where a null handle would be
attempted to be freed, like
[here](https://github.com/TileDB-Inc/TileDB/blob/9b4e5ea0c8b117716bc96dac71338ffc0d98a2db/tiledb/sm/cpp_api/array.h#L283)
or
[here](https://github.com/TileDB-Inc/TileDB/blob/9b4e5ea0c8b117716bc96dac71338ffc0d98a2db/tiledb/sm/cpp_api/current_domain.h#L74).
Some of them can be eliminated by refactoring the initialization of the
smart pointers, but this change is nevertheless valuable, because not
all cases can be migrated, and null smart pointers are valid either way.
---
TYPE: CPP_API
DESC: Fix error log messages when using the `Array` class in the C++
API.Deleter to not free null pointers. (#5262)1 parent 097f155 commit 84ff80c
1 file changed
+46
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
77 | 79 | | |
78 | 80 | | |
79 | 81 | | |
80 | 82 | | |
| 83 | + | |
| 84 | + | |
81 | 85 | | |
82 | 86 | | |
83 | 87 | | |
84 | 88 | | |
| 89 | + | |
| 90 | + | |
85 | 91 | | |
86 | 92 | | |
87 | 93 | | |
88 | 94 | | |
| 95 | + | |
| 96 | + | |
89 | 97 | | |
90 | 98 | | |
91 | 99 | | |
92 | 100 | | |
| 101 | + | |
| 102 | + | |
93 | 103 | | |
94 | 104 | | |
95 | 105 | | |
96 | 106 | | |
| 107 | + | |
| 108 | + | |
97 | 109 | | |
98 | 110 | | |
99 | 111 | | |
100 | 112 | | |
| 113 | + | |
| 114 | + | |
101 | 115 | | |
102 | 116 | | |
103 | 117 | | |
104 | 118 | | |
| 119 | + | |
| 120 | + | |
105 | 121 | | |
106 | 122 | | |
107 | 123 | | |
108 | 124 | | |
| 125 | + | |
| 126 | + | |
109 | 127 | | |
110 | 128 | | |
111 | 129 | | |
112 | 130 | | |
| 131 | + | |
| 132 | + | |
113 | 133 | | |
114 | 134 | | |
115 | 135 | | |
116 | 136 | | |
| 137 | + | |
| 138 | + | |
117 | 139 | | |
118 | 140 | | |
119 | 141 | | |
120 | 142 | | |
| 143 | + | |
| 144 | + | |
121 | 145 | | |
122 | 146 | | |
123 | 147 | | |
124 | 148 | | |
| 149 | + | |
| 150 | + | |
125 | 151 | | |
126 | 152 | | |
127 | 153 | | |
128 | 154 | | |
| 155 | + | |
| 156 | + | |
129 | 157 | | |
130 | 158 | | |
131 | 159 | | |
132 | 160 | | |
| 161 | + | |
| 162 | + | |
133 | 163 | | |
134 | 164 | | |
135 | 165 | | |
136 | 166 | | |
| 167 | + | |
| 168 | + | |
137 | 169 | | |
138 | 170 | | |
139 | 171 | | |
140 | 172 | | |
| 173 | + | |
| 174 | + | |
141 | 175 | | |
142 | 176 | | |
143 | 177 | | |
144 | 178 | | |
| 179 | + | |
| 180 | + | |
145 | 181 | | |
146 | 182 | | |
147 | 183 | | |
148 | 184 | | |
| 185 | + | |
| 186 | + | |
149 | 187 | | |
150 | 188 | | |
151 | 189 | | |
152 | 190 | | |
| 191 | + | |
| 192 | + | |
153 | 193 | | |
154 | 194 | | |
155 | 195 | | |
156 | 196 | | |
| 197 | + | |
| 198 | + | |
157 | 199 | | |
158 | 200 | | |
159 | 201 | | |
160 | 202 | | |
| 203 | + | |
| 204 | + | |
161 | 205 | | |
162 | 206 | | |
163 | 207 | | |
164 | 208 | | |
| 209 | + | |
| 210 | + | |
165 | 211 | | |
166 | 212 | | |
167 | 213 | | |
| |||
0 commit comments