[longomatch] Chain bin destructors to free player resources



commit 88d93f1721f4d0779714e8d0550b0ab33cb219fa
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Mon Jul 14 17:38:58 2014 +0200

    Chain bin destructors to free player resources

 LongoMatch.GUI.Multimedia/Gui/PlayerBin.cs         |   10 +++++-----
 LongoMatch.GUI.Multimedia/Gui/PlayerCapturerBin.cs |    7 +++++++
 LongoMatch.GUI/Gui/Component/AnalysisComponent.cs  |    6 ++++++
 LongoMatch.GUI/Gui/Component/ProjectPeriods.cs     |    6 ++++++
 LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs        |    6 ++++++
 5 files changed, 30 insertions(+), 5 deletions(-)
---
diff --git a/LongoMatch.GUI.Multimedia/Gui/PlayerBin.cs b/LongoMatch.GUI.Multimedia/Gui/PlayerBin.cs
index feac6a8..ec084f6 100644
--- a/LongoMatch.GUI.Multimedia/Gui/PlayerBin.cs
+++ b/LongoMatch.GUI.Multimedia/Gui/PlayerBin.cs
@@ -98,6 +98,11 @@ namespace LongoMatch.Gui
                }
 
                #endregion
+               protected override void OnDestroyed ()
+               {
+                       player.Dispose();
+                       base.OnDestroyed ();
+               }
 
                #region Properties
 
@@ -554,11 +559,6 @@ namespace LongoMatch.Gui
                        vwin.Show();
                }
 
-               void OnDestroyEvent(object o, Gtk.DestroyEventArgs args)
-               {
-                       player.Dispose();
-               }
-
                void OnVolumeChanged(double level) {
                        player.Volume = level;
                        if(level == 0)
diff --git a/LongoMatch.GUI.Multimedia/Gui/PlayerCapturerBin.cs 
b/LongoMatch.GUI.Multimedia/Gui/PlayerCapturerBin.cs
index 960a9a3..fff9aa3 100644
--- a/LongoMatch.GUI.Multimedia/Gui/PlayerCapturerBin.cs
+++ b/LongoMatch.GUI.Multimedia/Gui/PlayerCapturerBin.cs
@@ -49,6 +49,13 @@ namespace LongoMatch.Gui
                        ConnectSignals();
                }
                
+               protected override void OnDestroyed ()
+               {
+                       playerbin.Destroy ();
+                       capturerbin.Destroy ();
+                       base.OnDestroyed ();
+               }
+               
                public PlayerOperationMode Mode {
                        set {
                                mode = value;
diff --git a/LongoMatch.GUI/Gui/Component/AnalysisComponent.cs 
b/LongoMatch.GUI/Gui/Component/AnalysisComponent.cs
index 921505a..d760bef 100644
--- a/LongoMatch.GUI/Gui/Component/AnalysisComponent.cs
+++ b/LongoMatch.GUI/Gui/Component/AnalysisComponent.cs
@@ -49,6 +49,12 @@ namespace LongoMatch.Gui.Component
                        ConnectSignals();
                }
                
+               protected override void OnDestroyed ()
+               {
+                       playercapturer.Destroy ();
+                       base.OnDestroyed ();
+               }
+               
                public IPlayerBin Player{
                        get {
                                return playercapturer;
diff --git a/LongoMatch.GUI/Gui/Component/ProjectPeriods.cs b/LongoMatch.GUI/Gui/Component/ProjectPeriods.cs
index 69235e7..bde4890 100644
--- a/LongoMatch.GUI/Gui/Component/ProjectPeriods.cs
+++ b/LongoMatch.GUI/Gui/Component/ProjectPeriods.cs
@@ -48,6 +48,12 @@ namespace LongoMatch.Gui.Component
                                                        Catalog.GetString ("Synchronize the game periods"),
                                                        "  ⬇</b>");
                }
+               
+               protected override void OnDestroyed ()
+               {
+                       playerbin2.Destroy ();
+                       base.OnDestroyed ();
+               }
 
                public Project Project {
                        set {
diff --git a/LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs b/LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs
index dd9487b..d5c9eff 100644
--- a/LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs
+++ b/LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs
@@ -97,6 +97,12 @@ namespace LongoMatch.Gui.Panel
                        filelabel.ModifyFg (StateType.Normal, red);
                }
                
+               protected override void OnDestroyed ()
+               {
+                       projectperiods1.Destroy ();
+                       base.OnDestroyed ();
+               }
+               
                void LoadTeams () {
                        drawingarea1.HeightRequest = 200;
                        teamtagger = new TeamTagger (new WidgetWrapper (drawingarea1));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]