Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 857cdff0 authored by Henrik Baard's avatar Henrik Baard
Browse files

Memory leak in IInputMethodSessionWrapper executeMessage

In some cases the executeMessage is called with
mInputMethodSession == null. For the messages

DO_UPDATE_SELECTION, DO_APP_PRIVATE_COMMAND

memory is leaked. This commit recycles the args freeing
the allocated memory.
parent 523db46f
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -75,7 +75,15 @@ class IInputMethodSessionWrapper extends IInputMethodSession.Stub
    @Override
    public void executeMessage(Message msg) {
        if (mInputMethodSession == null) {
            // The session has been finished.
            // The session has been finished. Args needs to be recycled
            // for cases below.
            switch (msg.what) {
                case DO_UPDATE_SELECTION:
                case DO_APP_PRIVATE_COMMAND: {
                    SomeArgs args = (SomeArgs)msg.obj;
                    args.recycle();
                }
            }
            return;
        }