Skip to content

Commit

Permalink
Some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
graphitemaster committed Dec 15, 2016
1 parent 38fb290 commit 485976e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
1 change: 1 addition & 0 deletions r_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ model::model()
: m_geomMethods(&geomMethods::instance())
, m_indices(0)
, m_half(false)
, m_stats(nullptr)
{
}

Expand Down
6 changes: 5 additions & 1 deletion r_world.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,11 @@ bool World::PointLightChunk::buildMesh(kdMap *map) {

///! modelChunk
World::ModelChunk::ModelChunk()
: collect(false)
: frame(0.0f)
, collect(false)
, highlight(false)
, visible(false)
, model(nullptr)
{
}

Expand Down Expand Up @@ -432,8 +434,10 @@ ColorGrader *World::getColorGrader() {
///! world
World::World()
: m_geomMethods(&geomMethods::instance())
, m_gun(nullptr)
, m_kdWorld(nullptr)
, m_uploaded(false)
, m_stats(nullptr)
{
}

Expand Down
2 changes: 1 addition & 1 deletion s_memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ U_MALLOC_LIKE void *Memory::reallocate(void *old, size_t resize) {
}

void Memory::free(void *old) {
neoFree(old);
del(old);
neoFree(old);
}

void Memory::maybeRehash() {
Expand Down
2 changes: 1 addition & 1 deletion u_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@ inline void buffer<T>::swap(buffer<T> &other) {
template <typename T>
inline void buffer<T>::shrink_to_fit() {
if (last == first) {
neoFree(first);
capacity = first;
neoFree(first);
} else if (capacity != last) {
const size_t size = size_t(last - first);
T *resize = (T*)neoMalloc(sizeof *resize * size);
Expand Down
10 changes: 8 additions & 2 deletions u_log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ Logger Log::err(stderr);
Logger Log::out(stdout);
#endif

Logger::Logger(FILE *fp) {
Logger::Logger(FILE *fp)
: m_mutex(nullptr)
, m_file(nullptr)
{
// prevent concurrent initialization
if (SDL_AtomicAdd(&m_init, 1) != 0) return;
m_mutex = (void *)SDL_CreateMutex();
Expand All @@ -24,7 +27,10 @@ Logger::Logger(FILE *fp) {
setvbuf(m_file, nullptr, _IONBF, 0);
}

Logger::Logger(const char *file) {
Logger::Logger(const char *file)
: m_mutex(nullptr)
, m_file(nullptr)
{
// prevent concurrent initialization
if (SDL_AtomicAdd(&m_init, 1) != 0) return;
m_mutex = (void *)SDL_CreateMutex();
Expand Down

0 comments on commit 485976e

Please sign in to comment.