Fixed a problem with object lifetime and tiling processor input found after GC became active. Added a documentation hint.

This commit is contained in:
Matthias Koefferlein 2022-11-23 01:03:36 +01:00
parent 7431ec6f43
commit e04875b4e0
2 changed files with 28 additions and 2 deletions

View File

@ -417,6 +417,9 @@ Class<db::TilingProcessor> decl_TilingProcessor ("db", "TilingProcessor",
"Regions don't always come with a database unit, hence a database unit should be specified with the \\dbu= method unless "
"a layout object is specified as input too.\n"
"\n"
"Caution: the Region object must stay valid during the lifetime of the tiling processor. Take care to store it in "
"a variable to prevent early destruction of the Region object. Not doing so may crash the application.\n"
"\n"
"The name specifies the variable under which the input can be used in the scripts."
) +
method_ext ("input", &tp_input9, gsi::arg ("name"), gsi::arg ("region"), gsi::arg ("trans"),
@ -425,6 +428,9 @@ Class<db::TilingProcessor> decl_TilingProcessor ("db", "TilingProcessor",
"Regions don't always come with a database unit, hence a database unit should be specified with the \\dbu= method unless "
"a layout object is specified as input too.\n"
"\n"
"Caution: the Region object must stay valid during the lifetime of the tiling processor. Take care to store it in "
"a variable to prevent early destruction of the Region object. Not doing so may crash the application.\n"
"\n"
"The name specifies the variable under which the input can be used in the scripts."
"\n"
"This variant allows one to specify an additional transformation too. It has been introduced in version 0.23.2.\n"
@ -435,6 +441,9 @@ Class<db::TilingProcessor> decl_TilingProcessor ("db", "TilingProcessor",
"Edge collections don't always come with a database unit, hence a database unit should be specified with the \\dbu= method unless "
"a layout object is specified as input too.\n"
"\n"
"Caution: the Edges object must stay valid during the lifetime of the tiling processor. Take care to store it in "
"a variable to prevent early destruction of the Edges object. Not doing so may crash the application.\n"
"\n"
"The name specifies the variable under which the input can be used in the scripts."
) +
method_ext ("input", &tp_input11, gsi::arg ("name"), gsi::arg ("edges"), gsi::arg ("trans"),
@ -443,6 +452,9 @@ Class<db::TilingProcessor> decl_TilingProcessor ("db", "TilingProcessor",
"Edge collections don't always come with a database unit, hence a database unit should be specified with the \\dbu= method unless "
"a layout object is specified as input too.\n"
"\n"
"Caution: the Edges object must stay valid during the lifetime of the tiling processor. Take care to store it in "
"a variable to prevent early destruction of the Edges object. Not doing so may crash the application.\n"
"\n"
"The name specifies the variable under which the input can be used in the scripts."
"\n"
"This variant allows one to specify an additional transformation too. It has been introduced in version 0.23.2.\n"
@ -454,6 +466,9 @@ Class<db::TilingProcessor> decl_TilingProcessor ("db", "TilingProcessor",
"Edge pair collections don't always come with a database unit, hence a database unit should be specified with the \\dbu= method unless "
"a layout object is specified as input too.\n"
"\n"
"Caution: the EdgePairs object must stay valid during the lifetime of the tiling processor. Take care to store it in "
"a variable to prevent early destruction of the EdgePairs object. Not doing so may crash the application.\n"
"\n"
"The name specifies the variable under which the input can be used in the scripts."
"\n"
"This variant has been introduced in version 0.27.\n"
@ -464,6 +479,9 @@ Class<db::TilingProcessor> decl_TilingProcessor ("db", "TilingProcessor",
"Edge pair collections don't always come with a database unit, hence a database unit should be specified with the \\dbu= method unless "
"a layout object is specified as input too.\n"
"\n"
"Caution: the EdgePairs object must stay valid during the lifetime of the tiling processor. Take care to store it in "
"a variable to prevent early destruction of the EdgePairs object. Not doing so may crash the application.\n"
"\n"
"The name specifies the variable under which the input can be used in the scripts."
"\n"
"This variant has been introduced in version 0.27.\n"
@ -474,6 +492,9 @@ Class<db::TilingProcessor> decl_TilingProcessor ("db", "TilingProcessor",
"Text collections don't always come with a database unit, hence a database unit should be specified with the \\dbu= method unless "
"a layout object is specified as input too.\n"
"\n"
"Caution: the Texts object must stay valid during the lifetime of the tiling processor. Take care to store it in "
"a variable to prevent early destruction of the Texts object. Not doing so may crash the application.\n"
"\n"
"The name specifies the variable under which the input can be used in the scripts."
"\n"
"This variant has been introduced in version 0.27.\n"
@ -484,6 +505,9 @@ Class<db::TilingProcessor> decl_TilingProcessor ("db", "TilingProcessor",
"Text collections don't always come with a database unit, hence a database unit should be specified with the \\dbu= method unless "
"a layout object is specified as input too.\n"
"\n"
"Caution: the Texts object must stay valid during the lifetime of the tiling processor. Take care to store it in "
"a variable to prevent early destruction of the Texts object. Not doing so may crash the application.\n"
"\n"
"The name specifies the variable under which the input can be used in the scripts."
"\n"
"This variant has been introduced in version 0.27.\n"

View File

@ -4222,11 +4222,13 @@ CODE
tp.output("res", res)
tp.input("input", self.data)
tp.threads = (@engine.threads || 1)
if tile_boundary
tp.input("boundary", tile_boundary.data)
boundary = tile_boundary.data
else
tp.input("boundary", RBA::Region::new(self.data.bbox))
boundary = RBA::Region::new(self.data.bbox)
end
tp.input("boundary", boundary)
tp.var("vmin", limits[0] || 0.0)
tp.var("vmax", limits[1] || 1.0)