diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/gfx/font.h | 5 | ||||
-rw-r--r-- | app/sql/connection.h | 11 |
2 files changed, 13 insertions, 3 deletions
diff --git a/app/gfx/font.h b/app/gfx/font.h index 80a85ec..6be42ee 100644 --- a/app/gfx/font.h +++ b/app/gfx/font.h @@ -169,7 +169,6 @@ class Font { int ave_char_width, int style, int dlu_base_x); - ~HFontRef(); // Accessors HFONT hfont() const { return hfont_; } @@ -181,6 +180,10 @@ class Font { const std::wstring& font_name() const { return font_name_; } private: + friend class base::RefCounted<HFontRef>; + + ~HFontRef(); + const HFONT hfont_; const int height_; const int baseline_; diff --git a/app/sql/connection.h b/app/sql/connection.h index e87baa8..e7c2a2d 100644 --- a/app/sql/connection.h +++ b/app/sql/connection.h @@ -76,7 +76,6 @@ class Connection; // corruption, low-level IO errors or locking violations. class ErrorDelegate : public base::RefCounted<ErrorDelegate> { public: - virtual ~ErrorDelegate() {} // |error| is an sqlite result code as seen in sqlite\preprocessed\sqlite3.h // |connection| is db connection where the error happened and |stmt| is // our best guess at the statement that triggered the error. Do not store @@ -89,6 +88,11 @@ class ErrorDelegate : public base::RefCounted<ErrorDelegate> { // re-tried then returning SQLITE_OK is appropiate; otherwise is recomended // that you return the original |error| or the appropiae error code. virtual int OnError(int error, Connection* connection, Statement* stmt) = 0; + + protected: + friend class base::RefCounted<ErrorDelegate>; + + virtual ~ErrorDelegate() {} }; class Connection { @@ -286,7 +290,6 @@ class Connection { // Default constructor initializes to an invalid statement. StatementRef(); StatementRef(Connection* connection, sqlite3_stmt* stmt); - ~StatementRef(); // When true, the statement can be used. bool is_valid() const { return !!stmt_; } @@ -304,6 +307,10 @@ class Connection { void Close(); private: + friend class base::RefCounted<StatementRef>; + + ~StatementRef(); + Connection* connection_; sqlite3_stmt* stmt_; |