1

I am using OpenTok Framework and it cause crash when my app goes to background and foreground multiple times. May be it is due to memory loss but i have tried on instrument and enabled zombie objects and malloc guard but nothing helps me out.

Here are few of my crash listing from Crashlytics.

1).
webrtc::StatsReport::Value* std::__uninitialized_copy_aux<__gnu_cxx::__normal_iterator<webrtc::StatsReport::Value const*, std::vector<webrtc::StatsReport::Value, std::allocator<webrtc::StatsReport::Value> > >, webrtc::StatsReport::Value*>(__gnu_cxx::__normal_iterator<webrtc::StatsReport::Value const*, std::vector<webrtc::StatsReport::Value, std::allocator<webrtc::StatsReport::Value> > >, __gnu_cxx::__normal_iterator<webrtc::StatsReport::Value const*, std::vector<webrtc::StatsReport::Value, std::allocator<webrtc::StatsReport::Value> > >, webrtc::StatsReport::Value*, std::__false_type)

2).
AudioToolbox
AUIOHelper::NotifyInputAvailable(AudioTimeStamp const&, unsigned long, AudioBufferList const&)

The way i am using openTok library is:

- (void)doConnect
{
    // Create a session to the doctor.
    _mySession = [[OTSession alloc] initWithSessionId:self.doctor.sessionId
                                             delegate:self];

    // Connect the session created to the doctor.
    [_mySession connectWithApiKey:kApiKey token:self.doctor.token];

}

- (void)doPublish
{
    // Create a publisher.
    _publisher = [[OTPublisher alloc] initWithDelegate:self name:UIDevice.currentDevice.name];
    [_publisher.view.toolbarView setHidden:NO];
    [_publisher.view.toolbarView setAlpha:1.0];

    // Publish user's stream to the connected session.
    [_mySession publish:_publisher];

    // Show user's stream in bottom-right corner.
    CGRect frame = CGRectMake(self.view.frame.size.width - mySize.width, self.view.frame.size.height - mySize.height - 50, mySize.width, mySize.height);
    _publisherView = _publisher.view;
    [_publisherView setFrame:CGRectInset(frame, 10, 10)];
    [self.cameraView addSubview:_publisherView];

}

pragma mark - OTSessionDelegate Methods

- (void)sessionDidConnect:(OTSession*)session
{
    [self doPublish];
}

- (void)session:(OTSession*)mySession didReceiveStream:(OTStream*)stream
{
    if (![stream.connection.connectionId isEqualToString:_mySession.connection.connectionId])
    {
        [self doSubscribeToStream:stream];
    }
}

- (void)doSubscribeToStream:(OTStream *)stream
{
    self.lblDoctorName.text = self.doctor.name;
    if (!_subscriber) {
        _subscriber = [[OTSubscriber alloc] initWithStream:stream delegate:self];
    }
}

Can any one help me out in these crashes ?

1 Answers1

0

There were some crashing issues in the iOS SDK on OpenTok. There was a big iOS SDK release a few days ago that addresses the crashing and should fix your issue: http://tokbox.com/opentok/libraries/client/ios/

songz
  • 2,082
  • 1
  • 14
  • 18