From 3d2029049957d073cf660c51269d81a907c85070 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20K=C3=B6fferlein?= Date: Fri, 3 Jul 2020 23:41:20 +0200 Subject: [PATCH] Fixed #596 (crash on library _destroy) (#597) --- src/db/db/dbLibrary.h | 1 + src/db/db/gsiDeclDbLibrary.cc | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/src/db/db/dbLibrary.h b/src/db/db/dbLibrary.h index 21cd70061..0c45b0c5a 100644 --- a/src/db/db/dbLibrary.h +++ b/src/db/db/dbLibrary.h @@ -238,6 +238,7 @@ namespace tl */ template <> struct type_traits : public type_traits { typedef tl::false_tag has_copy_constructor; + typedef tl::false_tag has_public_destructor; }; } diff --git a/src/db/db/gsiDeclDbLibrary.cc b/src/db/db/gsiDeclDbLibrary.cc index cfd1f5f2f..d0b552aa8 100644 --- a/src/db/db/gsiDeclDbLibrary.cc +++ b/src/db/db/gsiDeclDbLibrary.cc @@ -78,7 +78,18 @@ static std::string get_technology (db::Library *lib) } } +static void dummy_destroy (db::Library *) { } + Class decl_Library ("db", "Library", + gsi::method_ext ("_destroy", &dummy_destroy, + "@brief An inactive substitute for _destroy (delete the object)\n" + "As libraries need to be kept if cells are using them, library objects must " + "not be deleted. Hence the default '_destroy' implementation must not be called. " + "To keep old code working, this substitute is provided. It just returns without " + "deleting the object.\n" + "\n" + "This method has been introduced in version 0.26.7." + ) + gsi::constructor ("new", &new_lib, "@brief Creates a new, empty library" ) +