Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
0d252ef3
Commit
0d252ef3
authored
Jan 18, 2017
by
Tiago Cunha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a memory leak
parent
18170308
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
InputHostnameFragment.java
...android/fragment/server_config/InputHostnameFragment.java
+11
-1
No files found.
app/src/main/java/chat/rocket/android/fragment/server_config/InputHostnameFragment.java
View file @
0d252ef3
...
...
@@ -17,6 +17,7 @@ import chat.rocket.android.helper.TextUtils;
import
chat.rocket.android.model.ServerConfig
;
import
chat.rocket.android.realm_helper.RealmObjectObserver
;
import
chat.rocket.android.realm_helper.RealmStore
;
import
rx.Subscription
;
import
rx.android.schedulers.AndroidSchedulers
;
import
rx.schedulers.Schedulers
;
...
...
@@ -29,6 +30,8 @@ public class InputHostnameFragment extends AbstractServerConfigFragment {
realm
.
where
(
ServerConfig
.
class
).
equalTo
(
ServerConfig
.
ID
,
serverConfigId
))
.
setOnUpdateListener
(
this
::
onRenderServerConfig
);
Subscription
serverPolicySubscription
;
public
InputHostnameFragment
()
{
}
...
...
@@ -60,7 +63,11 @@ public class InputHostnameFragment extends AbstractServerConfigFragment {
final
ServerPolicyApiValidationHelper
validationHelper
=
new
ServerPolicyApiValidationHelper
(
serverPolicyApi
);
ServerPolicyHelper
.
isApiVersionValid
(
validationHelper
)
if
(
serverPolicySubscription
!=
null
)
{
serverPolicySubscription
.
unsubscribe
();
}
serverPolicySubscription
=
ServerPolicyHelper
.
isApiVersionValid
(
validationHelper
)
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
...
...
@@ -79,6 +86,9 @@ public class InputHostnameFragment extends AbstractServerConfigFragment {
@Override
public
void
onDestroyView
()
{
serverConfigObserver
.
unsub
();
if
(
serverPolicySubscription
!=
null
)
{
serverPolicySubscription
.
unsubscribe
();
}
super
.
onDestroyView
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment