I am wondering how the background thread's (tasks) method variable are garbage collected when they are still used in UI thread which is called within same method. Do we need to free them manually?
For example I launch a background task where I get some array of data from rest service and store it in a method variable. Then in same background task's method I invoke the UI thread and use the background created data to manipulate bindable UI array. Would it be good idea now to free up the data array which was created in background thread? or it will garbage collected efficiently?