Question: Trying to add a portfolio gallery to a custom wp theme I am making. I have exhausted myself on trying to search for solutions and plugins that could even be modified some. I think one of my issues in finding a solution is that I am not entirely sure what search terms would help me find something similar to what I am trying to achieve..

As of right now, I have the following div for my navigation

```
<div id="tags" role="navigation">
<p>
<a class="portrait" href="#portrait">Portrait</a> / 
<a class="landscape" href="#landscape">Landscape</a> / 
<a class="sports" href="#sports">Sports</a> / 
<a class="nature" href="#nature">Nature</a> / 
<a class="weddings" href="#weddings">Weddings</a> / 
<a class="active" href="#">All</a>
</p>
</div>

```

Below my navigation is where I have my images div. What I would like to do is be able to select a category from the images navigation and have only those specifically tagged images show. What I don't want is to have a new page open up for that tag/selection made. I would like to have the images reorganize or fade in/out for the selected navigation.

Im sure there is a script or plugin out there that would be similar to what I am looking for. Or a little guidance/suggestion on how to best achieve this would be appreciated.

Thanks in advance.

Answer: 
You ask,

> 
> “What happens when an unhandled exception is thrown from a constructor? For Java, and for C++? Will there be a memory leak?”
> 
> 
> 

An **unhandled exception** is an exception that does not have an associated handler.

In C++ any unhandled exception terminates the program. It is unspecified whether the stack is unwound in this case, i.e. destructors of successfully constructed local variables may be executed or not depending on the compiler. Where the exception is throw from (such as inside a constructor) is irrelevant.

> 
> **C++11 §15.3/9**:  
> 
>  “If no matching handler is found, the function `std::terminate()` is called; whether or not the stack is unwound before this call to `std::terminate()` is implementation-defined.”
> 
> 
> 

An unhandled exception in Java likewise necessarily terminates the program, or at least the current thread if it’s not the main thread, but with guaranteed calls of `finally` clauses:

> 
> **Java SE 7 Language Specification §11.3**:  
> 
>  “If no `catch` clause that can handle an exception can be found, then the current thread (the thread that encountered the exception) is terminated. Before termination, all
>  `finally` clauses are executed […]”
> 
> 
> 

Since the program terminates there is in practice no memory leak for the program itself, because in practice the operating system cleans up after a process.

However, a crashing program may leave temporary files on disk, and it may leak other resources from server processes, including memory leaks in those server processes.
Well, in C++ at least, an unhandled exception would just go on and on until it reaches your main() and thus closes your program. Not freed memory would then be taken care of by the operating system.

Not sure if that answers your question...?

So, basically, it's just like if it was thrown from any other function.