Skip to content

Commit

Permalink
Simplify ConnectionI.checkState in JavaScript (#2989)
Browse files Browse the repository at this point in the history
  • Loading branch information
pepone authored Oct 28, 2024
1 parent c8b64e4 commit 379e2b1
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions js/src/Ice/ConnectionI.js
Original file line number Diff line number Diff line change
Expand Up @@ -1488,22 +1488,12 @@ export class ConnectionI {
}

checkState() {
if (this._state < StateHolding || this._upcallCount > 0) {
return;
}

//
// We aren't finished until the state is finished and all
// outstanding requests are completed. Otherwise we couldn't
// guarantee that there are no outstanding calls when deactivate()
// is called on the servant locators.
//
if (this._state === StateFinished && this._finishedPromises.length > 0) {
//
// Clear the OA. See bug 1673 for the details of why this is necessary.
//
this._adapter = null;
this._finishedPromises.forEach(p => p.resolve());
// We aren't finished until the state is finished and all outstanding requests are completed. Otherwise we
// couldn't guarantee that there are no outstanding calls when deactivate() is called on the servant locators.
if (this._state === StateFinished && this._upcallCount === 0) {
for (const p of this._finishedPromises) {
p.resolve();
}
this._finishedPromises = [];
}
}
Expand Down

0 comments on commit 379e2b1

Please sign in to comment.