If you look at the Origin C language reference documentation for GraphPage, you will see that it is derived from OriginObject->PageBase->Page->GraphPage and so it inherits methods and properties from these other classes. And in OriginObject class, there is a Destroy method.
So you can use that method to delete the graph page with code such as: gpg.Destroy();