Create a class in Python that makes a connection to an active database, and closes the connection when the class is deleted.
class DatabaseConnection:
    def __init__(self):
        self.conn = psycopg2.connect(host="localhost", database="mydb")

    def __del__(self):
        self.conn.close()