Most of the time I see some C++ programmers who check if a pointer is NULL before deleting it.

1
2
3
4
if (ptr != NULL) {
delete ptr;
ptr = NULL;
}

Well, according to C++03 [ISO/IEC IS 14882:2003] §5.3.5/2 which explicitly states:

…if the value of the operand of delete is the null pointer the operation has no effect.

Therefore, deleting a NULL pointer has no effect (if the deallocation function is one supplied in the standard library), so it is not necessary to check for a NULL pointer before calling delete.

1
2
delete ptr;
ptr = NULL;
  • Note: Keep in mind that deleting a void* pointer results in undefined behavior whether it’s NULL or not.

Read on...


As you’ve noticed there’s still no official support for Microsoft Visual Studio 2012 in recent Pixel Mine nFringe releases. While ago I came across an awesome forum post at Epic Games Forums which describs a simple process of getting nFringe to work with VS2012. Since then I’ve used it in my day to day development tasks and I had no difficulties at all using it. And damn, it’s pretty stable despite the fact that not officially supported by Pixel Mine. Even nFringe version 1.1 which I’ve tested is playing nice with VS2012.

The only prerequisite that you need is your previous VS2010 + nFringe installation to obtain some files from it. Once you’ve acquired these files you don’t need VS2010 or nFringe installer for further installations.

1. Open Windows Command Prompt (cmd.exe) and run the following commands:

xcopy /E "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Pixel Mine" "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\"

xcopy /E "C:\Program Files (x86)\Microsoft Visual Studio 10.0\UnrealScript" "C:\Program Files (x86)\Microsoft Visual Studio 11.0\"

2. Open up extension.vsixmanifest in Notepad or your favorite editor and change VisualStudio Version to 11 (Note: In the following path change 1.1 with your nfringe version, e.g. 1.2).

notepad "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Pixel Mine nFringe (UnrealScript)\1.1\extension.vsixmanifest"
1
2
3
<InstalledByMsi>true</InstalledByMsi>
<SupportedProducts>
<VisualStudio Version="11.0">

3. Run the following command to register nFringe extension in Visual Studio 2012:

"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe" /setup

4. Finally, you need to re-validate your nFringe license in VS2012.

Happy coding ;)

Read on...


Well, I’ve failed to install .NET Framework 2.0/3.5 in Windows 8 using Program and Features in Control Panel, which I need for an older project I’ve done long ago. But I came across an easy solution which did the trick.

In Windows Command Prompt (cmd.exe) or Run dialog, enter the following command and hit Enter:

Dism /online /enable-feature /featurename:NetFx3 /All /Source:x:\sources\sxs /LimitAccess

Replace x: with path of your Windows 8 installation DVD.

  • Note: You have to run cmd.exe as Administrator in order for this to work!

Read on...