File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -222,10 +222,12 @@ import CZitiPrivate
222222
223223 /// Certificte PEM (possibly multiple certificates)
224224 public var certPEM : String = " "
225+
226+ /// pointer to result of parsing event's `config_json` field. allocated by ziti-sdk-c
227+ private var ziti_cfg_ptr : UnsafeMutablePointer < ziti_config > ?
225228
226229 init ( _ ziti: Ziti , _ evt: UnsafePointer < config_event > ) {
227230 super. init ( ziti)
228- var ziti_cfg_ptr : UnsafeMutablePointer < ziti_config > ?
229231 parse_ziti_config_ptr ( & ziti_cfg_ptr, evt. pointee. config_json, strlen ( evt. pointee. config_json) )
230232 self . controllerUrl = toStr ( ziti_cfg_ptr? . pointee. controller_url)
231233
@@ -245,6 +247,12 @@ import CZitiPrivate
245247 self . certPEM = toStr ( ziti_cfg_ptr? . pointee. id. cert)
246248 }
247249
250+ deinit {
251+ if ziti_cfg_ptr != nil {
252+ free_ziti_config_ptr ( ziti_cfg_ptr)
253+ }
254+ }
255+
248256 /// Debug description
249257 /// - returns: String containing debug description of this event
250258 public override var debugDescription : String {
You can’t perform that action at this time.
0 commit comments