diff --git a/cmd/ethereum/js.go b/cmd/ethereum/js.go
index 88d16d6a82d8b0cdd335b7a0d43e21e757948054..6f0ac526f23b497665263c83a9034a359fa13cd7 100644
--- a/cmd/ethereum/js.go
+++ b/cmd/ethereum/js.go
@@ -91,6 +91,7 @@ func newJSRE(ethereum *eth.Ethereum, libPath string) *jsre {
 func (js *jsre) apiBindings() {
 
 	ethApi := rpc.NewEthereumApi(js.xeth, js.ethereum.DataDir)
+	ethApi.Close()
 	//js.re.Bind("jeth", rpc.NewJeth(ethApi, js.re.ToVal))
 
 	jeth := rpc.NewJeth(ethApi, js.re.ToVal, js.re)
diff --git a/rpc/api.go b/rpc/api.go
index 4cd88aa7188340c05d3d2b9ec330568b40f728bb..19bd9b70797e521a81c2aa0fb32fb00780068a96 100644
--- a/rpc/api.go
+++ b/rpc/api.go
@@ -44,6 +44,10 @@ func (api *EthereumApi) xethAtStateNum(num int64) *xeth.XEth {
 	return api.xeth().AtStateNum(num)
 }
 
+func (api *EthereumApi) Close() {
+	api.db.Close()
+}
+
 func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error {
 	// Spec at https://github.com/ethereum/wiki/wiki/Generic-JSON-RPC
 	rpclogger.Debugf("%s %s", req.Method, req.Params)