From ffa92bec7742194294a34c538ddc33827057168f Mon Sep 17 00:00:00 2001 From: Filipe David Manana Date: Thu, 7 Oct 2010 23:40:16 +0100 Subject: [PATCH] catch exception if cache process is dead when trying to stop it --- term_cache.erl | 3 ++- term_cache_trees.erl | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/term_cache.erl b/term_cache.erl index afde428..acf78a1 100644 --- a/term_cache.erl +++ b/term_cache.erl @@ -78,7 +78,8 @@ start_link(Options) -> %% @spec stop(cache()) -> ok stop(Cache) -> - ok = gen_server:call(Cache, stop). + catch gen_server:call(Cache, stop), + ok. init(Options) -> diff --git a/term_cache_trees.erl b/term_cache_trees.erl index b38f918..5f482fe 100644 --- a/term_cache_trees.erl +++ b/term_cache_trees.erl @@ -77,7 +77,8 @@ start_link(Options) -> %% @spec stop(cache()) -> ok stop(Cache) -> - ok = gen_server:call(Cache, stop). + catch gen_server:call(Cache, stop), + ok. init(Options) ->