Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » Splitter » Uninitialised value in SplitterFrame
Uninitialised value in SplitterFrame [message #40213] Wed, 03 July 2013 18:09 Go to next message
Novo is currently offline  Novo
Messages: 890
Registered: December 2006
Experienced Contributor
How to reproduce: run reference/DockingExample1 with valgrind. You will get a report below.
==22097== Conditional jump or move depends on uninitialised value(s)
==22097==    at 0x454D75: Upp::SplitterFrame::SetStyle(Upp::Splitter::Style const&) (FrameSplitter.cpp:123)
==22097==    by 0x454E72: Upp::SplitterFrame::SplitterFrame() (FrameSplitter.cpp:137)
==22097==    by 0x5151FB: Upp::DockWindow::DockWindow() (DockWindow.cpp:1457)
==22097==    by 0x408F84: DockingExample::DockingExample() (main.cpp:32)
==22097==    by 0x4098FC: GuiMainFn_() (main.cpp:103)
==22097==    by 0x63765B: Upp::AppExecute__(void (*)()) (App.cpp:322)
==22097==    by 0x4098C1: main (main.cpp:101)
==22097==  Uninitialised value was created by a stack allocation
==22097==    at 0x4098D8: GuiMainFn_() (main.cpp:102)


The problem is in code below.
SplitterFrame& SplitterFrame::SetStyle(const Splitter::Style& s)
{
	if(style != &s) {
		style = &s;
		RefreshLayout();
		Refresh();
	}
	return *this;
}

SplitterFrame::SplitterFrame()
{
	type = LEFT;
	size = size0 = 4;
	minsize = 0;
	sizemin = 0;
	SetStyle(Splitter::StyleDefault());
}


When constructor of SplitterFrame calls SetStyle() "style" is still unitialized. IMHO, it is safe to set it to NULL in constructor.

Thanks.


Regards,
Novo
Re: Uninitialised value in SplitterFrame [message #40580 is a reply to message #40213] Sun, 18 August 2013 16:10 Go to previous message
mirek is currently offline  mirek
Messages: 12096
Registered: November 2005
Ultimate Member
Thanks, fixed!

Mirek
Previous Topic: multiple controls on a splitter side
Next Topic: SetParent to SplitterFrame
Goto Forum:
  


Current Time: Tue Nov 12 22:04:04 CET 2019

Total time taken to generate the page: 0.00931 seconds