Changeset 81c6e32180ba6f1018c28ae75b7281fd38121812

Show
Ignore:
Timestamp:
09/10/10 22:34:43 (21 months ago)
Author:
Antti-Juhani Kaijanaho <antti-juhani@…>
Children:
99057e4d73dbb905f06f5ccc4ea49708b8aaa0a8
Parents:
c53e53f1cb0d542e5c931555a591d2589c033006
git-committer:
Antti-Juhani Kaijanaho <antti-juhani@…> (09/10/10 22:34:43)
Message:

Exception-proof destructors.

Hopefully addresses #78.

Signed-off-by: Antti-Juhani Kaijanaho <antti-juhani@…>

Files:
3 modified

Legend:

Unmodified
Added
Removed
  • logger/logline.hh

    r868b365 r81c6e32  
    11/*  This file is part of Alue, the multiprotocol Internet discussion daemon 
    22 
    3     Copyright © 2009 Antti-Juhani Kaijanaho 
     3    Copyright © 2009, 2010 Antti-Juhani Kaijanaho 
    44 
    55    Alue is free software: you can redistribute it and/or modify it 
     
    3939                        : valid(false) 
    4040                        { if (doOpen) open(); } 
    41                 ~logline() { if (valid) close(); } 
     41                ~logline() { 
     42                        try 
     43                        { 
     44                                if (valid) close(); 
     45                        } 
     46                        catch (std::exception) 
     47                        {} 
     48                } 
    4249 
    4350                void open(); 
  • nntp/connection.cc

    r67c3cdb r81c6e32  
    578578        connection::~connection() 
    579579        { 
    580                 logger::logline ll; 
    581                 ll << loghead << "dying"; 
    582                 ll.close();                 
     580                try 
     581                { 
     582                        logger::logline ll; 
     583                        ll << loghead << "dying"; 
     584                        ll.close(); 
     585                } catch (std::exception) 
     586                {} 
    583587        } 
    584588 
  • tls/session.hh

    r08f5bd7 r81c6e32  
    256256                        {} 
    257257 
    258                 ~session() { impl->kill(); } 
     258                ~session() { 
     259                        try 
     260                        { 
     261                                impl->kill(); 
     262                        } 
     263                        catch (std::exception) 
     264                        {} 
     265                } 
    259266 
    260267                void kill() { impl->kill(); }