You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 14, 2024. It is now read-only.
I am using ARC version of the library in my non-ARC project. I am using the method explained in this tutorial to merge non-ARC project and ARC library. In this method the library is compiled as a static library (in ARC mode itself) and added as a second target to the project.
In my ViewController file I am initializing the socket using
which results socketIODidDisconnect delegate method to fire.
- (void) socketIODidDisconnect:(SocketIO *)socket{
[chatSockIO release]; ==> is this call needed?
}
Now my question is about the line [chatSockIO release]. Should we need to release an object which itself is defined in ARC mode, but is used in a non-ARC project?
When I run this code with the line uncommented I am getting a crash saying,
-[SocketIO retain]: message sent to deallocated instance 0x6fec370
I tried run with zombies and it gave me the fully retain/release cycle of the sockIO object
To check I commented the [chatSockIO release] line and put a log in dealloc function of SocketIO class. When I run there is no crash, but dealloc is not getting called and Allocations instrument shows memory is not getting released.
- (void) socketIODidDisconnect:(SocketIO *)socket{
//[chatSockIO release]; //==> is this call needed?
}
I am using ARC version of the library in my non-ARC project. I am using the method explained in this tutorial to merge non-ARC project and ARC library. In this method the library is compiled as a static library (in ARC mode itself) and added as a second target to the project.
In my ViewController file I am initializing the socket using
and when I need to disconnect, I call
[chatSockIO disconnect];
which results
socketIODidDisconnect
delegate method to fire.Now my question is about the line
[chatSockIO release]
. Should we need to release an object which itself is defined in ARC mode, but is used in a non-ARC project?When I run this code with the line uncommented I am getting a crash saying,
I tried run with zombies and it gave me the fully retain/release cycle of the sockIO object
To check I commented the
[chatSockIO release]
line and put a log indealloc
function of SocketIO class. When I run there is no crash, butdealloc
is not getting called and Allocations instrument shows memory is not getting released.So how to release socketIO class in a non-ARC project?
Note : Yesterday I asked the same question on a generic way in stackoverflow. But no one was able to answer.
The text was updated successfully, but these errors were encountered: