How to release the pins of LCD shield

After initializing the lcd shield with “lcd =display.SPIDisplay()”, I want to release the pins occupied by the LCD shield at a certain point in time. I found the function for releasing pins in the library manual: “lcd.deinit()”. However, it is indicated that the deinit function does not exist. Are there any other ways to release the pins of lcd shield?

Just delete the display object.