Ruby mark_function example and docs fixes
Relates to Ruby trackings hash bug #225
This commit is contained in:
parent
8a6874e633
commit
b5873218b6
2 changed files with 3 additions and 3 deletions
|
|
@ -4818,7 +4818,7 @@ public:
|
||||||
class Zoo
|
class Zoo
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
std::vector<animal *=""> animals;
|
std::vector<Animal *> animals;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Construct an empty zoo
|
// Construct an empty zoo
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ begin
|
||||||
zoo.add_animal(tiger1)
|
zoo.add_animal(tiger1)
|
||||||
|
|
||||||
# unset variables to force gc
|
# unset variables to force gc
|
||||||
tiger = nil
|
tiger1 = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
GC.start
|
GC.start
|
||||||
|
|
@ -20,4 +20,4 @@ tiger2 = zoo.get_animal(0)
|
||||||
# Call a method to verify the animal is still valid and not gc'ed
|
# Call a method to verify the animal is still valid and not gc'ed
|
||||||
if tiger2.get_name != "tiger1"
|
if tiger2.get_name != "tiger1"
|
||||||
raise RuntimeError, "Wrong animal name"
|
raise RuntimeError, "Wrong animal name"
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue