finestructure / Graf

1 stars 0 forks source link

App crashes after a couple of minutes #14

Closed finestructure closed 12 years ago

finestructure commented 12 years ago

Observations:

finestructure commented 12 years ago

Crash seems to happen when the server drops the connection eventually:

2012-02-01 17:51:59.967 Graf[2178:707] logged in as 50402 2012-02-01 17:52:01.220 Graf[2178:707] current command: user 2012-02-01 17:52:01.222 Graf[2178:707] server said: {"is_banned": false, "status": 0, "rate": 0.139, "balance": 641.902, "user": 50402} 2012-02-01 17:52:01.224 Graf[2178:707] KVO: isFinished <BalanceRequest: 0x346b30> { kind = 1; } 2012-02-01 17:52:03.864 Graf[2178:3713] elapsed: 15.0 2012-02-01 17:52:03.866 Graf[2178:3713] result: 431.501159.6 2012-02-01 17:52:03.869 Graf[2178:3713] done 2012-02-01 17:53:59.186 Graf[2178:707] Stream end event

Need to check how we handle the "done" event and if we clean up properly.

finestructure commented 12 years ago

Doesn't seem to be directly related to the Stream end event. It crashed again but without the printout (than again maybe the crash happened just before the console buffer was flushed).

The error is an EXC_BAD_ACCESS.

finestructure commented 12 years ago

With NSZombie enabled we get:

2012-02-02 09:24:19.747 Graf[2831:707] Stream end event 2012-02-02 09:24:19.749 Graf[2831:707] *\ -[BalanceRequest retain]: message sent to deallocated instance 0x331ca0

This happens here: https://github.com/sas71/Graf/blob/master/Main/DbcConnector.m#L349

        if ([self.delegate respondsToSelector:@selector(didDisconnect)]) {
          [self.delegate didDisconnect];
        }
finestructure commented 12 years ago

Reproducible, same spot, when the stream is closed.