c++ 'switch-on' generating uninitialized code that leads to segfault
Hi! Thanks for the great tool. I have been experimenting with it lately and I so far I really like it. Writing binary parsers is not fun anymore.

Ok, now on to the problem...

##### The yaml

```yaml
meta:
  id: j29
  endian: be
  bit-endian: be
seq:
  - id: packets
    type: packet
    repeat: eos
    if: false

types:
  packet:
    seq:
      - id: header
        type: generic_header
        size: sizeof<generic_header>
      - id: packet_type
        type:
          switch-on: header.type
          cases:
            'packet_type::signal_data': signal_data
            'packet_type::context_packet': context_data

  generic_header:
    seq:
      - id: type
        type: b4
        enum: packet_type
        valid: 
          any-of:
            - packet_type::signal_data
            - packet_type::context_packet
      - type: b28
```

##### Generates this data in the header file:

```cpp
private:
    std::vector<packet_t*>* m_packets;
    bool n_packets;
```

##### And this constructor:

```cpp
j29_t::packet_t::packet_t(kaitai::kstream* p__io, j29_t* p__parent, j29_t* p__root) : kaitai::kstruct(p__io) {
    m__parent = p__parent;
    m__root = p__root;
    m_header = 0;
    m__io__raw_header = 0;

    try {
        _read();
    } catch(...) {
        _clean_up();
        throw;
    }
}
```

Notice that `m_packets` and `n_packets` are not initialized? This can lead to the following cleanup code actually deleting a packet that was never actually created.

##### CPP file

```cpp
void j29_t::packet_t::_clean_up() {
<snip>
    if (!n_packet_type) {
        if (m_packet_type) {
            delete m_packet_type; m_packet_type = 0;
        }
    }
}
```

If I set `m_packet_type = NULL` in the constructor, all is well. But really, all private variables need to be initialized in the constructor to be safe.

Are there any current workarounds?

Thanks!