summaryrefslogtreecommitdiff
path: root/UnoControls
diff options
context:
space:
mode:
authoraleksandar-stefanovic <theonewithideas@gmail.com>2017-01-14 17:54:45 +0100
committerAleksandar Stefanović <theonewithideas@gmail.com>2017-01-25 09:16:51 +0000
commit96b2aa3f820f4cc65904195cde12e305434a732c (patch)
tree10f5ef5aa5c14736b9499720577812de351f62e4 /UnoControls
parentd49e497a6bd07e487149d65ab63138ce4aff73a4 (diff)
Reduce usage of memory-leaking Context object
Huge refactoring of the methods to use the passed instance of the Context object instead of using the static one. I couldn't completely remove the static object, because it requires restructuring of the workflow so that it originates from the activity, and not from some other random place. The way it was refactored is: 1. Find a place where the static object (LibreOfficeMainActivity.mAppContext) is used. 2. Add a LibreOfficeMainActivity object to the method signature. 3. Repeat the process with a method that calls it, and repeat until the LibreOfficeMainActivity object isn't available, so that it can be passed through all the methods, to the place where the static object was used. 4. Replace that static object with the parameter of the function. The commit looks pretty huge, but it's basically just the simple refactoring explained above. The memory leak isn't completely gone, but this a progress towards it. Also moved the "global" objects of Handler and LOKitThread from an Activity to an Application, which is the correct place for "global" variables. Can someone explain why Handler and LOKitThread are used? They seem to mostly do nothing, but steeply increasing the complexity of the application. Change-Id: Ib2be77fa3adea94d6b7849d0e2afa90bf318d68b Reviewed-on: https://gerrit.libreoffice.org/33073 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Aleksandar Stefanović <theonewithideas@gmail.com>
Diffstat (limited to 'UnoControls')
0 files changed, 0 insertions, 0 deletions