you're problem is that you are declaring a global in a header file like that. What happens is that each cpp file that includes that utils header, gets its own copy of the static variable. You end up with many, and depending how you initialize them, destructor mayhem.
Simple Test:
//util.h
#pragma once
#include <iostream>
#include <string>
static int globali = 5;
//main.cpp
#include "utilglobals.h"
#include "cpp2.h"
void main() {
testGlobal();
std::cout << "main" << (int)&globali << std::endl;
std::cin.get();
}
//cpp2.h
#pragma once
#include "utilglobals.h"
void testGlobal();
//cpp2.cpp
#include "cpp2.h"
void testGlobal() {
std::cout << "cpp2" << (int)&globali << std::endl;
}