Skip to content
This repository was archived by the owner on Jul 14, 2020. It is now read-only.

Commit a799abf

Browse files
committed
Close statement before the complete connection (Fixes #2)
1 parent 20cf8bc commit a799abf

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

src/main/java/io/github/lucaseasedup/logit/storage/SqliteStorage.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,35 +64,35 @@ public void ping() throws IOException
6464
@Override
6565
public void close() throws IOException
6666
{
67-
if (connection != null)
67+
if (statement != null)
6868
{
6969
try
7070
{
71-
connection.close();
71+
statement.close();
7272
}
7373
catch (SQLException ex)
7474
{
7575
throw new IOException(ex);
7676
}
7777
finally
7878
{
79-
connection = null;
79+
statement = null;
8080
}
8181
}
82-
83-
if (statement != null)
82+
83+
if (connection != null)
8484
{
8585
try
8686
{
87-
statement.close();
87+
connection.close();
8888
}
8989
catch (SQLException ex)
9090
{
9191
throw new IOException(ex);
9292
}
9393
finally
9494
{
95-
statement = null;
95+
connection = null;
9696
}
9797
}
9898
}

0 commit comments

Comments
 (0)