dji-sdk / Mobile-SDK-iOS

DJI Mobile SDK for iOS: http://developer.dji.com/mobile-sdk/
Other
578 stars 255 forks source link

DJIWaypointReachedMissionTrigger cann't deinit when inheritance #372

Closed fanbaoyuanbees360 closed 4 years ago

fanbaoyuanbees360 commented 4 years ago

I have an inheritance DJIWaypointReachedMissionTrigger trigger. The following code:

class BeesWaypointReachedMissionTrigger: DJIWaypointReachedMissionTrigger {
    init(waypointIndex: Int) {
        super.init()
        self.waypointIndex = waypointIndex

        print(">>> *** BeesWaypointReachedMissionTrigger init\(self)")
    }

    deinit {
        print(">>> *** BeesWaypointReachedMissionTrigger deinit\(self)")
    }
}

I use the trigger in waypointMission, and the action of trigger work, but when the timeline finish, when self.missionControl.isTimelineRunning == false, I clear the timeline:

missionControl.removeAllListeners()
missionControl.stopTimeline()
missionControl.unscheduleEverything()

but the BeesWaypointReachedMissionTrigger deinit not work. As long as the timeline is running, I stop and unscheduleEverything,the deinit of trigger will work.

DJIWaypointReachedMissionTrigger whether can be used by inheritance?

DJI

pod 'DJI-SDK-iOS', '~> 4.12' pod 'DJI-UXSDK-iOS', '~> 4.12' pod 'DJIWidget', '~> 1.6.2' pod 'DJIFlySafeDatabaseResource', '~> 01.00.01.17' pod 'iOS-Color-Picker'

dji-dev commented 4 years ago

Agent comment from Luce Luo in Zendesk ticket #37174:

Dear Customer,

Thank you for contacting DJI. Sorry that the DJIWaypointReachedMissionTrigger is not allowed to use by inheritance. There are some related and closed logics in the inner MSDK.

Thanks,

Luce Luo DJI Developer Support