paramitising class instances

I am trying to pass a class instance to a function. It compiles fine and actually works but it then stops all calling of that class from working.
This is using the AdaFruit neopixel library:- get it here
To illustrate the effect I have made a simplified piece of code that just flashes the third LED in the strip red / green. This is the code that will not work:-

// test for passing class instance
#define PINfor1   7 // pin connected to the small NeoPixels strip
#define NUMPIXELS1      6 // number of LEDs on second strip

#include <Adafruit_NeoPixel.h>

unsigned long patternInterval = 600 ; // how often LEDs change
unsigned long lastUpdate = 0;

int bufferSize = NUMPIXELS1;

Adafruit_NeoPixel strip1 = Adafruit_NeoPixel(NUMPIXELS1, PINfor1, NEO_GRB + NEO_KHZ800);

/* ****function prototype**** */
void wipe2( Adafruit_NeoPixel strip); 

void setup() {
   strip1.begin(); // This initializes the NeoPixel library for pattern 1.
   wipe2(strip1); // <-- comment out this line and un comment the next and it works
  // wipe();

}

void loop(){
if(millis() - lastUpdate > patternInterval) updatePattern();
}

void updatePattern(){ // just a red/ green blinking LED 
  static int state = 0;
   if (state == 1){
   strip1.setPixelColor(2, strip1.Color(0xff,0,0)); // red
   } else {
   strip1.setPixelColor(2, strip1.Color(0x00,0xff,0)); // green
   }
   state++;
   if(state >1) state =0;
   strip1.show();
  lastUpdate = millis(); // time for next frame display
}

void wipe2(Adafruit_NeoPixel strip){
     for(int i=0;i<bufferSize;i++){
       strip.setPixelColor(i, strip.Color(0,0,0)); 
       }
       strip.show(); // <-- this shows that this function works
}

void wipe(){
       for(int i=0;i<bufferSize;i++){
       strip1.setPixelColor(i, strip1.Color(0,0,0)); 
  }
}

However if I never call the wipe2 function that passes the class over and instead call the wipe function everything works. The code change is to change the setup function to:-

void setup() {
   strip1.begin(); // This initializes the NeoPixel library for pattern 1.
  // wipe2(strip1); // <-- comment out this line and un comment the next and it works
   wipe();
}

Am I doing anything wrong here?

The wipe2 function actually works as you can see any residual LEDs being cleared, but once it is called none of the rest of the code produces any LED action.

My guess is the pass by value of the object.

Try changing the prototype to pass by reference.

void wipe2( Adafruit_NeoPixel& strip, int pattern);

Thanks.
Changing the prototype definition and the function definition did the trick.
+1