From fdf81fe975e42bcf276dfd3abe5e65b43c13aa43 Mon Sep 17 00:00:00 2001 From: FreakyCoder Date: Sun, 8 Mar 2020 18:20:21 +0300 Subject: [PATCH] PR Merge #84: Weak Delegate Fix --- Example/StompClientLib.swift | 4 ++-- StompClientLib.podspec | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Example/StompClientLib.swift b/Example/StompClientLib.swift index 3d1cbe4..486cc00 100755 --- a/Example/StompClientLib.swift +++ b/Example/StompClientLib.swift @@ -59,7 +59,7 @@ public enum StompAckMode { } // Fundamental Protocols -public protocol StompClientLibDelegate { +public protocol StompClientLibDelegate: class { func stompClient(client: StompClientLib!, didReceiveMessageWithJSONBody jsonBody: AnyObject?, akaStringBody stringBody: String?, withHeader header:[String:String]?, withDestination destination: String) func stompClientDidDisconnect(client: StompClientLib!) @@ -72,7 +72,7 @@ public protocol StompClientLibDelegate { public class StompClientLib: NSObject, SRWebSocketDelegate { var socket: SRWebSocket? var sessionId: String? - var delegate: StompClientLibDelegate? + weak var delegate: StompClientLibDelegate? var connectionHeaders: [String: String]? public var connection: Bool = false public var certificateCheckEnabled = true diff --git a/StompClientLib.podspec b/StompClientLib.podspec index e636438..7b63c66 100755 --- a/StompClientLib.podspec +++ b/StompClientLib.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'StompClientLib' - s.version = '1.3.7' + s.version = '1.3.8' s.summary = 'Simple STOMP Client library. Swift 3, 4, 4.2, 5 compatible' s.swift_version = '4.0', '4.2', '5.0'