Carl Walther GmbH has filed for a patent on a mechanism which prevents a pistol being disassembled if a round is chambered. It works by using the extractor to manipulate a pin which prevents the disassembly.
Personally, I think all gadgets like this are unnecessary. Police departments, on the other hand, love these kind of features. That the Glock requires its trigger to be pulled on disassembly has often been cited as a reason police have switched away from the Glock in favor of its competitors.
The patent application can be viewed online at Scribd.com.