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
082d996b
Commit
082d996b
authored
Jul 18, 2018
by
Lucio Maciel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix crash when disposing an uninitialized Disposable
parent
6ffa4788
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
ProfileFragment.kt
...in/java/chat/rocket/android/profile/ui/ProfileFragment.kt
+5
-4
No files found.
app/src/main/java/chat/rocket/android/profile/ui/ProfileFragment.kt
View file @
082d996b
...
...
@@ -14,6 +14,7 @@ import chat.rocket.android.profile.presentation.ProfileView
import
chat.rocket.android.util.extension.asObservable
import
chat.rocket.android.util.extensions.*
import
dagger.android.support.AndroidSupportInjection
import
io.reactivex.disposables.CompositeDisposable
import
io.reactivex.disposables.Disposable
import
io.reactivex.rxkotlin.Observables
import
kotlinx.android.synthetic.main.avatar_profile.*
...
...
@@ -28,7 +29,7 @@ class ProfileFragment : Fragment(), ProfileView, ActionMode.Callback {
private
lateinit
var
currentEmail
:
String
private
lateinit
var
currentAvatar
:
String
private
var
actionMode
:
ActionMode
?
=
null
private
lateinit
var
editTextsDisposable
:
Disposable
private
val
editTextsDisposable
=
CompositeDisposable
()
companion
object
{
fun
newInstance
()
=
ProfileFragment
()
...
...
@@ -170,7 +171,7 @@ class ProfileFragment : Fragment(), ProfileView, ActionMode.Callback {
}
private
fun
subscribeEditTexts
()
{
editTextsDisposable
=
Observables
.
combineLatest
(
editTextsDisposable
.
add
(
Observables
.
combineLatest
(
text_name
.
asObservable
(),
text_username
.
asObservable
(),
text_email
.
asObservable
(),
...
...
@@ -186,11 +187,11 @@ class ProfileFragment : Fragment(), ProfileView, ActionMode.Callback {
}
else
{
finishActionMode
()
}
}
}
)
}
private
fun
unsubscribeEditTexts
()
{
editTextsDisposable
.
dispose
()
editTextsDisposable
.
clear
()
}
private
fun
startActionMode
()
{
...
...
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