Browse Source

fix Makefile rules for 'unittests'. Fix a crash in the Logger during unittest shutdown (and possibly also in JSON adapter's shutdown, too).

Release_2.1
roker 5 months ago
parent
commit
3d7f977e37
2 changed files with 4 additions and 3 deletions
  1. +2
    -2
      server/Makefile
  2. +2
    -1
      server/logger.cc

+ 2
- 2
server/Makefile View File

@ -78,7 +78,7 @@ else
endif
ALL_SOURCE=$(filter-out parse_mail.cc unittest_%.cc, $(wildcard *.cc))
ALL_SOURCE=$(filter-out parse_mail.cc unittest_%.cc servertest.cc, $(wildcard *.cc))
MA_SOURCE=$(wildcard mini-adapter-*.cc)
LIB_SOURCE=$(filter-out $(MA_SOURCE) $(OMIT_NFC_SOURCE), $(ALL_SOURCE))
@ -124,7 +124,7 @@ $(TARGET): $(LIB_TARGET) $(MA_OBJECTS) $(SPIRIT_OBJECTS)
unittests: $(TEST_OBJECTS) $(LIB_TARGET) $(SPIRIT_OBJECTS)
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS) -lgtest -lgtest_main
parse_mail: parse_mail.o nfc.o $(LIB_TARGET) $(SPIRIT_OBJECTS)
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)


+ 2
- 1
server/logger.cc View File

@ -110,9 +110,10 @@ namespace LoggerS // namespace containing all data for the Logger singleton. HA
{
~LogfileCloser()
{
Lock LCK(LoggerS::mut);
if(LoggerS::logfile)
{
LoggerS::log(Logger::Debug, "Shutdown.");
// LoggerS::log(Logger::Debug, "Shutdown.");
fputs("---<shutdown>---\n", LoggerS::logfile);
fclose(LoggerS::logfile);
LoggerS::logfile = nullptr;


Loading…
Cancel
Save