Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions lib/features/postgresql/postgres_browser_views.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,6 @@ class _PostgresIndexListViewState
@override
void dispose() {
_scroll.dispose();
if (_loading) {
PostgresService.instance.interrupt(
widget.connectionRow,
database: widget.database,
mode: PgSessionMode.readOnly,
);
}
_lease?.release();
super.dispose();
}
Expand Down Expand Up @@ -227,13 +220,6 @@ class _PostgresTriggerListViewState
@override
void dispose() {
_scroll.dispose();
if (_loading) {
PostgresService.instance.interrupt(
widget.connectionRow,
database: widget.database,
mode: PgSessionMode.readOnly,
);
}
_lease?.release();
super.dispose();
}
Expand Down Expand Up @@ -399,13 +385,6 @@ class _PostgresTypeListViewState extends material.State<PostgresTypeListView> {
@override
void dispose() {
_scroll.dispose();
if (_loading) {
PostgresService.instance.interrupt(
widget.connectionRow,
database: widget.database,
mode: PgSessionMode.readOnly,
);
}
_lease?.release();
super.dispose();
}
Expand Down Expand Up @@ -551,13 +530,6 @@ class _PostgresExtensionListViewState
@override
void dispose() {
_scroll.dispose();
if (_loading) {
PostgresService.instance.interrupt(
widget.connectionRow,
database: widget.database,
mode: PgSessionMode.readOnly,
);
}
_lease?.release();
super.dispose();
}
Expand Down Expand Up @@ -697,13 +669,6 @@ class _PostgresFdwListViewState extends material.State<PostgresFdwListView> {
@override
void dispose() {
_scroll.dispose();
if (_loading) {
PostgresService.instance.interrupt(
widget.connectionRow,
database: widget.database,
mode: PgSessionMode.readOnly,
);
}
_lease?.release();
super.dispose();
}
Expand Down
13 changes: 4 additions & 9 deletions lib/features/postgresql/postgres_stats_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,13 @@ class _PostgresStatsViewState extends material.State<PostgresStatsView> {
@override
void dispose() {
_timer?.cancel();
_disconnectCurrent(interruptIfBusy: _loading);
_disconnectCurrent();
super.dispose();
}

void _disconnectCurrent({bool interruptIfBusy = false}) {
if (interruptIfBusy && _loading) {
PostgresService.instance.interrupt(
widget.connectionRow,
database: widget.connectionRow.databaseName ?? 'postgres',
mode: PgSessionMode.readOnly,
);
}
/// Releases the lease. The session is shared with the object tree, other
/// views and MCP, so closing this view never interrupts it.
void _disconnectCurrent() {
_lease?.release();
_lease = null;
}
Expand Down
Loading