diff --git a/uppsrc/Core/Random.cpp b/uppsrc/Core/Random.cpp index e589f13ee..9c3143da5 100644 --- a/uppsrc/Core/Random.cpp +++ b/uppsrc/Core/Random.cpp @@ -74,14 +74,19 @@ static void sSeed(uint64 *s) force_inline static uint64 *sState() { + static bool forked; thread_local uint64 *s; - if(!s) { + if(!s || forked && Thread::IsMain()) { thread_local uint64 state[4]; s = state; sSeed(s); #ifdef PLATFORM_POSIX - if(Thread::IsMain()) // non-main threads do not work with fork anyway - pthread_atfork(NULL, NULL, [] { sSeed(s); }); // reseed random generator after fork + if(Thread::IsMain()) { // non-main threads do not work with fork anyway + ONCELOCK { + pthread_atfork(NULL, NULL, [] { forked = true; }); // reseed random generator after fork + } + forked = false; + } #endif } return s; diff --git a/uppsrc/CtrlCore/Ctrl.cpp b/uppsrc/CtrlCore/Ctrl.cpp index 2319ba934..ac6032bb0 100644 --- a/uppsrc/CtrlCore/Ctrl.cpp +++ b/uppsrc/CtrlCore/Ctrl.cpp @@ -529,6 +529,7 @@ Ctrl::Ctrl() { destroying = false; multi_frame = false; frame.frame = &NullFrame(); + frame.SetView(Null); enabled = visible = wantfocus = initfocus = true; editable = true; backpaint = IsCompositedGui() ? FULLBACKPAINT : TRANSPARENTBACKPAINT; diff --git a/uppsrc/CtrlCore/CtrlFrame.cpp b/uppsrc/CtrlCore/CtrlFrame.cpp index c29eaa19c..a9a8bdffa 100644 --- a/uppsrc/CtrlCore/CtrlFrame.cpp +++ b/uppsrc/CtrlCore/CtrlFrame.cpp @@ -10,6 +10,7 @@ Ctrl::Frame Ctrl::AllocFrames(int alloc) size_t sz0 = alloc * sizeof(Frame); size_t sz = sz0; m.frames = (Frame *)MemoryAllocSz(sz); +// memset(m.frames, 0, sz); _DBG_ m.multi.alloc = alloc + (int)((sz - sz0) / sizeof(Frame)); return m; } @@ -42,6 +43,7 @@ void Ctrl::InsertFrame(int i, CtrlFrame& fr) else memmove(frame.frames + i + 1, frame.frames + i, (frame.multi.count - i) * sizeof(Frame)); frame.frames[i].frame = &fr; + frame.frames[i].SetView(Null); frame.multi.count++; } fr.FrameAdd(*this); diff --git a/uppsrc/CtrlCore/GtkDrawImage.cpp b/uppsrc/CtrlCore/GtkDrawImage.cpp index faae07b14..e1dee0472 100644 --- a/uppsrc/CtrlCore/GtkDrawImage.cpp +++ b/uppsrc/CtrlCore/GtkDrawImage.cpp @@ -114,6 +114,8 @@ Draw& ImageDraw::Alpha() if(!alpha_surface) { alpha_surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, isz.cx, isz.cy); alpha.cr = cairo_create(alpha_surface); + // cairo_set_source_rgb(alpha.cr, 0, 0, 0); + // cairo_paint(alpha.cr); } return alpha; } @@ -181,6 +183,8 @@ void ImageDraw::Init(Size sz) isz = sz; surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, isz.cx, isz.cy); cr = cairo_create(surface); +// cairo_set_source_rgb(cr, 0, 0, 0); +// cairo_paint(cr); alpha_surface = NULL; del = true; } diff --git a/uppsrc/CtrlLib/EditField.cpp b/uppsrc/CtrlLib/EditField.cpp index f816b9d16..72852c236 100644 --- a/uppsrc/CtrlLib/EditField.cpp +++ b/uppsrc/CtrlLib/EditField.cpp @@ -1053,11 +1053,11 @@ void EditField::Reset() errorbg = nobg = false; charset = CHARSET_UTF8; alignright = false; + showspaces = false; + no_internal_margin = false; SetStyle(StyleDefault()); SetFrame(edge); font = StdFont(); - showspaces = false; - no_internal_margin = false; fsell = fselh = -1; DeleteAttr(ATTR_NULLICON); } diff --git a/uppsrc/CtrlLib/TreeCtrl.cpp b/uppsrc/CtrlLib/TreeCtrl.cpp index b42b07072..c485558a4 100644 --- a/uppsrc/CtrlLib/TreeCtrl.cpp +++ b/uppsrc/CtrlLib/TreeCtrl.cpp @@ -18,6 +18,7 @@ TreeCtrl::TreeCtrl() multiroot = false; chldlck = false; highlight_ctrl = false; + hasctrls = false; Clear(); SetFrame(ViewFrame()); AddFrame(sb); diff --git a/uppsrc/Draw/Image.cpp b/uppsrc/Draw/Image.cpp index e1565b1e9..e8eefc454 100644 --- a/uppsrc/Draw/Image.cpp +++ b/uppsrc/Draw/Image.cpp @@ -33,7 +33,7 @@ void ImageBuffer::Create(int cx, int cy) ASSERT(cx >= 0 && cy >= 0); size.cx = cx; size.cy = cy; - pixels.Alloc(GetLength()); + pixels.Alloc(GetLength(), RGBAZero()); #ifdef _DEBUG RGBA *s = pixels; RGBA *e = pixels + GetLength(); diff --git a/uppsrc/ide/clang/CurrentFile.cpp b/uppsrc/ide/clang/CurrentFile.cpp index e6cb5dd57..48ca5c773 100644 --- a/uppsrc/ide/clang/CurrentFile.cpp +++ b/uppsrc/ide/clang/CurrentFile.cpp @@ -207,6 +207,7 @@ void CurrentFileThread() current_file_event.Wait(); LLOG("Current file Thread::IsShutdownThreads() " << Thread::IsShutdownThreads()); } + s_cf.Clear(); LLOG("Current file thread exit"); } @@ -221,7 +222,6 @@ void SetCurrentFile(const CurrentFileContext& ctx, Event don Thread::Start([] { CurrentFileThread(); }); Thread::AtShutdown([] { LLOG("Shutdown current file"); - s_cf.Clear(); current_file_event.Broadcast(); }); } diff --git a/uppsrc/ide/clang/clang.h b/uppsrc/ide/clang/clang.h index 712c38ed0..a0c001e8b 100644 --- a/uppsrc/ide/clang/clang.h +++ b/uppsrc/ide/clang/clang.h @@ -135,10 +135,10 @@ struct AnnotationItem : Moveable { String nest; // Upp::Class String unest; // UPP::CLASS String bases; // base classes of struct/class - Point pos; - int kind; - bool definition; - bool isvirtual; + Point pos = Null; + int kind = Null; + bool definition = false; + bool isvirtual = false; void Serialize(Stream& s); }; diff --git a/uppsrc/ide/clang/macros.cpp b/uppsrc/ide/clang/macros.cpp index 0cef42c48..fecc87c21 100644 --- a/uppsrc/ide/clang/macros.cpp +++ b/uppsrc/ide/clang/macros.cpp @@ -3,6 +3,8 @@ // we are using libclang.dll for MSVC and therefore need to redefine standard macros // to mingw clang +//#BLITZ_PROHIBIT + const char umacros[] = R"(#define CHECK_GRID(g) #define CHECK_MATRIX(g) diff --git a/uppsrc/ide/ide.h b/uppsrc/ide/ide.h index 63fad3ce0..95a131e95 100644 --- a/uppsrc/ide/ide.h +++ b/uppsrc/ide/ide.h @@ -531,7 +531,7 @@ public: LineEdit::EditPos editpos; Point columnline; LineEdit::UndoData undodata; - int64 filehash; // make sure undodata work + int64 filehash = 0; // make sure undodata work LineInfo lineinfo; LineInfoRem lineinforem;