Skip to content

Commit 6814194

Browse files
committed
Add dealloc for ios
1 parent 18bccf9 commit 6814194

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

ios/FPStaticServer.m

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ - (instancetype)init {
1515
return self;
1616
}
1717

18+
- (void)dealloc {
19+
20+
if(_webServer.isRunning == YES) {
21+
[_webServer stop];
22+
}
23+
_webServer = nil;
24+
25+
}
26+
1827
- (dispatch_queue_t)methodQueue
1928
{
2029
return dispatch_queue_create("com.futurepress.staticserver", DISPATCH_QUEUE_SERIAL);
@@ -108,7 +117,6 @@ - (dispatch_queue_t)methodQueue
108117
if(_webServer.isRunning == YES) {
109118

110119
[_webServer stop];
111-
// _webServer = nil;
112120

113121
NSLog(@"StaticServer stopped");
114122
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-static-server",
3-
"version": "0.2.1",
3+
"version": "0.2.2",
44
"repository": "https://github.com/futurepress/react-native-static-server",
55
"description": "HTTP static file server for React Native",
66
"main": "index.js",

0 commit comments

Comments
 (0)