openbsd-ports/mail/archiveopteryx/patches/patch-db_database_cpp
landry 63fd810c25 Fix crash when connection to postgres fails, backported from upstream
git commit c3d5d52ad084a98cc161.
From Piotr Sikora, thanks!
2011-04-03 09:04:54 +00:00

15 lines
513 B
Plaintext

$OpenBSD: patch-db_database_cpp,v 1.1 2011/04/03 09:04:54 landry Exp $
Backport c3d5d52ad084a98cc161
Fix crash when connection to postgres fails.
--- db/database.cpp.orig
+++ db/database.cpp
@@ -339,6 +339,8 @@ void Database::removeHandle( Database * d )
return;
handles->remove( d );
+ if ( !totalDbConnections )
+ totalDbConnections = new GraphableNumber( "total-db-connections" );
totalDbConnections->setValue( handles->count() );
if ( !handles->isEmpty() )
return;