From c91af8d1f85f876eb7119ce8406385cf570d3886 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Benencia?= Date: Tue, 3 Sep 2013 15:39:46 -0300 Subject: Fixed file descriptor leak --- Types.hs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'Types.hs') diff --git a/Types.hs b/Types.hs index 86ca334..c5e9428 100644 --- a/Types.hs +++ b/Types.hs @@ -12,6 +12,7 @@ import Control.Monad.Reader(ReaderT) import Control.Monad.State(StateT) import Data.DateTime(DateTime) import System.FilePath(FilePath) +import System.IO(Handle) import UI.NCurses(Curses, Update, Color(..), ColorID) type LazymailUpdate = ReaderT LazymailConfig (StateT LazymailState Update) @@ -36,16 +37,17 @@ data LazymailConfig = LazymailConfig { } data Email = Email { - emailValue :: MIMEValue - , emailDate :: DateTime - , emailPath :: FilePath + emailValue :: MIMEValue + , emailDate :: DateTime + , emailPath :: FilePath + , emailHandle :: Handle } instance Eq Email where - (Email _ _ fp1) == (Email _ _ fp2) = fp1 == fp2 + (Email _ _ fp1 _) == (Email _ _ fp2 _) = fp1 == fp2 instance Ord Email where - (Email _ d1 _) `compare` (Email _ d2 _) = d1 `compare` d2 + (Email _ d1 _ _) `compare` (Email _ d2 _ _) = d1 `compare` d2 data Mode = MaildirMode | IndexMode | EmailMode | ComposeMode deriving (Show, Eq) -- cgit v1.2.3