mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-24 23:28:59 +01:00
Assert correctness in decrement_reference_count()
This commit is contained in:
parent
fa8c8f5850
commit
300d931922
@ -762,7 +762,8 @@ sub increment_reference_count( $$ ) {
|
|||||||
sub decrement_reference_count( $$ ) {
|
sub decrement_reference_count( $$ ) {
|
||||||
my ($toref, $chain) = @_;
|
my ($toref, $chain) = @_;
|
||||||
|
|
||||||
if ( $toref && $toref->{referenced} && $toref->{references}{$chain} ) {
|
if ( $toref && $toref->{referenced} ) {
|
||||||
|
assert($toref->{references}{$chain} > 0 );
|
||||||
delete $toref->{references}{$chain} unless --$toref->{references}{$chain};
|
delete $toref->{references}{$chain} unless --$toref->{references}{$chain};
|
||||||
delete_chain( $toref ) unless ( keys %{$toref->{references}} );
|
delete_chain( $toref ) unless ( keys %{$toref->{references}} );
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user