diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-08-12 02:11:09 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-08-12 02:11:09 +0200 |
commit | 180285af85c4c6c02c885dd6c276a33e0bf00d1a (patch) | |
tree | e94763647502151ee8034777680f5c991a625aaf | |
parent | 8dab9ed128f5a7f80917d1eb90eed902e1a333b6 (diff) | |
download | phi-180285af85c4c6c02c885dd6c276a33e0bf00d1a.tar phi-180285af85c4c6c02c885dd6c276a33e0bf00d1a.zip |
Fix message bus memory leak
-rw-r--r-- | lib/Phi/Widget.hs | 3 | ||||
-rw-r--r-- | lib/Phi/Widgets/Systray.hs | 3 | ||||
-rw-r--r-- | lib/Phi/Widgets/Taskbar.hs | 3 |
3 files changed, 5 insertions, 4 deletions
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 |