Skip to content

Commit

Permalink
Adds a call to stop in deinit if the server is running
Browse files Browse the repository at this point in the history
  • Loading branch information
KaneCheshire committed Jan 13, 2023
1 parent 8503ef6 commit 8ee24bb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Sources/Peasy/Server.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ public final class Server {
// MARK: Public

public init() {}

deinit {
switch state {
case .running: stop()
case .notRunning: break
}
}

// MARK: - Functions -
// MARK: Public
Expand Down

0 comments on commit 8ee24bb

Please sign in to comment.