MacBook Pro turn off when unplugged an external monitor
My mac only works when I connect an external HDMI monitor and this monitor is turned on. When I turn off the monitor or unplug the HDMI cable, my mac after a minute starts heating up and its fans make noise. Then the mac shuts down. It happens with the battery or the connected power source.
I have done a complete maintenance and cleaning. I've changed the thermal paste, cleaned the fans, even bought a new battery, just reset my mac and still have the same problem.
Any idea what could be going on?
MacBook Pro 15″, macOS 11.7