Skip to content

Cannot form weak reference to instance of class KoreBotSDK.RTMTimer #18

@jserranoglobant

Description

@jserranoglobant

Issue found on iOS-Kore-SDK tag version 0.16

When the disconnect method of BotClient is called continuously the RTMTimer is generating a crash. The RTMPersistenceConnection is deallocating the timerSource and after that in the deinit, the timer.setEventHandler {} is accessing a bad reference because the timer is nil. The log error message from Xcode console is: Cannot form weak reference to instance (0x1c524bca0) of class KoreBotSDK.RTMTimer. It is possible that this object was over-released, or is in the process of deallocation.

Please see the following evidence:

koreSDKCrashEvidence0

BotClient.swift
koreSDKCrashEvidence1

RTMPersistenceConnection.swift
koreSDKCrashEvidence2

RTMPersistenceConnection.swift - RTMTimer
koreSDKCrashEvidence3
koreSDKCrashEvidence4

RTMPersistenceConnection.swift - RTMTimer
koreSDKCrashEvidence5
koreSDKCrashEvidence6

This is our crash report from Crashlytics:

crashReport-main-threadKoreEvidence1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions