From 180285af85c4c6c02c885dd6c276a33e0bf00d1a Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 12 Aug 2011 02:11:09 +0200 Subject: Fix message bus memory leak --- lib/Phi/Widget.hs | 3 +-- lib/Phi/Widgets/Systray.hs | 3 ++- lib/Phi/Widgets/Taskbar.hs | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'lib/Phi') diff --git a/lib/Phi/Widget.hs b/lib/Phi/Widget.hs index 7bce659..0756e19 100644 --- a/lib/Phi/Widget.hs +++ b/lib/Phi/Widget.hs @@ -96,8 +96,7 @@ deriving instance Show WidgetState createWidgetState :: Phi -> Display -> Widget -> IO WidgetState createWidgetState phi disp (Widget w) = do - phi' <- dupPhi phi - priv <- initWidget w phi' disp + priv <- initWidget w phi disp return WidgetState { stateWidget = w , stateX = 0 , stateY = 0 diff --git a/lib/Phi/Widgets/Systray.hs b/lib/Phi/Widgets/Systray.hs index 60cfd76..b8b85d7 100644 --- a/lib/Phi/Widgets/Systray.hs +++ b/lib/Phi/Widgets/Systray.hs @@ -59,7 +59,8 @@ instance WidgetClass Systray where type WidgetData Systray = SystrayState initWidget (Systray) phi dispvar = do - forkIO $ systrayRunner phi dispvar + phi' <- dupPhi phi + forkIO $ systrayRunner phi' dispvar lastReset <- newIORef 0 return $ SystrayState phi (head . getScreens $ dispvar) 0 lastReset [] diff --git a/lib/Phi/Widgets/Taskbar.hs b/lib/Phi/Widgets/Taskbar.hs index 24f6611..a5a6fdc 100644 --- a/lib/Phi/Widgets/Taskbar.hs +++ b/lib/Phi/Widgets/Taskbar.hs @@ -165,7 +165,8 @@ instance WidgetClass Taskbar where type WidgetData Taskbar = TaskbarState initWidget (Taskbar _) phi dispvar = do - forkIO $ taskbarRunner phi dispvar + phi' <- dupPhi phi + forkIO $ taskbarRunner phi' dispvar return $ TaskbarState 0 0 (-1) [] M.empty M.empty M.empty M.empty -- cgit v1.2.3