Skip to content

Commit 85330c0

Browse files
committed
Bugfix: Destructor was ok as it was
1 parent 27cb982 commit 85330c0

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

sqlite_modern_cpp.h

+4-6
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,13 @@ namespace sqlite {
9696
public:
9797
friend class database;
9898
~database_binder() {
99+
/* Will be executed if no >>op is found */
99100
if( _stmt ) {
100-
/* Wastes A LOT of time
101101
int hresult;
102-
if( (hresult = sqlite3_step( _stmt )) != SQLITE_DONE ) {
103-
if( hresult == SQLITE_ROW )
104-
throw std::runtime_error( "not all rows readed" );
105-
throw std::runtime_error( sqlite3_errmsg( _db ) );
102+
if( sqlite3_step( _stmt ) != SQLITE_DONE ) {
103+
throw std::runtime_error( sqlite3_errmsg( _db ) );
106104
}
107-
*/
105+
108106
if( sqlite3_finalize( _stmt ) != SQLITE_OK )
109107
throw std::runtime_error( sqlite3_errmsg( _db ) );
110108
_stmt = nullptr;

0 commit comments

Comments
 (0)