d03 check ok pour leaks et correction warning copy contructor avec g++

This commit is contained in:
hugogogo
2022-03-14 18:01:40 +01:00
parent a3a82c1c18
commit aa6f1c9928
31 changed files with 23 additions and 732 deletions

View File

@@ -52,6 +52,9 @@ $(OBJS): $(HEADERS:%=$(D_HEADERS)/%)
$(NAME): $(OBJS)
$(CC) $(OBJS) -o $@ $(LIBS)
leaks: $(NAME)
valgrind --leak-check=full --show-leak-kinds=all ./$(NAME)
clean:
rm -f $(OBJS)

View File

@@ -13,7 +13,9 @@ ScavTrap::ScavTrap( std::string name ) : ClapTrap(name) {
return;
}
ScavTrap::ScavTrap( ScavTrap const & src ) {
// base class better be explicitly called (g++ warning)
// https://stackoverflow.com/questions/43612772/base-class-class-a-should-be-explicitly-initialized-in-the-copy-constructor
ScavTrap::ScavTrap( ScavTrap const & src ) : ClapTrap(src) {
_class = _dClass;
*this = src;
_number = getTotalNumber();

Binary file not shown.