ecere/gui/Window: Prevent uninitialized values if base Window methods not overridden... master
authorJerome St-Louis <jerome@ecere.com>
Mon, 30 Jan 2017 04:23:48 +0000 (23:23 -0500)
committerJerome St-Louis <jerome@ecere.com>
Mon, 30 Jan 2017 04:23:48 +0000 (23:23 -0500)
- This was causing very bad behaviors (system lockups on Windows) for a user trying to implement a skin

ecere/src/gui/Window.ec

index 3778155..5965634 100644 (file)
@@ -8138,10 +8138,11 @@ public:
    virtual void OnChildResized(Window child, int x, int y, int w, int h);
 
    // Skins Virtual Functions
-   virtual void GetDecorationsSize(MinMaxValue * w, MinMaxValue * h);
-   virtual void SetWindowMinimum(MinMaxValue * mw, MinMaxValue * mh);
+   virtual void GetDecorationsSize(MinMaxValue * w, MinMaxValue * h) { *w = 0, *h = 0; }
+   virtual void SetWindowMinimum(MinMaxValue * mw, MinMaxValue * mh) { *mw = 0, *mh = 0; }
    virtual void SetWindowArea(int * x, int * y, MinMaxValue * w, MinMaxValue * h, MinMaxValue * cw, MinMaxValue * ch)
    {
+      *x = 0, *y = 0;
       *cw = *w;
       *ch = *h;
    }