Ignore:
Timestamp:
01/18/13 10:26:25 (9 years ago)
Author:
ascheibe
Message:

#2005

  • fixed naming of event handlers that were forgotten when the naming from experiment to job was changed
  • fixed some more memory leaks
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UnloadJobs/HeuristicLab.Clients.Hive/3.3/RefreshableJob.cs

    r9169 r9173  
    562562
    563563    public Guid Id {
    564       get { return job.Id; }
     564      get {
     565        if (job == null) return Guid.Empty;
     566        return job.Id;
     567      }
    565568      set { job.Id = value; }
    566569    }
     
    614617        jobDownloader = null;
    615618      }
     619      if (jobResultPoller != null) {
     620        DeregisterResultPollingEvents();
     621        jobResultPoller = null;
     622      }
     623      if (hiveTasks != null) {
     624        DisposeTasks();
     625      }
    616626      if (job != null) {
    617627        DeregisterJobEvents();
    618628        job = null;
    619629      }
    620       if (hiveTasks != null) {
    621         DeregisterHiveTasksEvents();
    622         hiveTasks.Clear(); // this should remove the item_StateLogChanged event handlers
    623         hiveTasks = null;
    624       }
    625       if (jobResultPoller != null) {
    626         DeregisterResultPollingEvents();
    627         jobResultPoller = null;
    628       }
     630    }
     631
     632    private void DisposeTasks() {
     633      DeregisterHiveTasksEvents();
     634      foreach (var task in hiveTasks) {
     635        task.Dispose();
     636      }
     637      hiveTasks.Clear(); // this should remove the item_StateLogChanged event handlers
     638      hiveTasks = null;
    629639    }
    630640    #endregion
Note: See TracChangeset for help on using the changeset viewer.