Change interrupt from rising to falling edge inside interrupt service routine

In my code I change interrupt from rising to falling edge inside interrupt service routine.
It seems to be working, but is it safe the way I do it?

This is the ISR I use :

/* Interrupt routines  */

void Isr_SensorRising()
{
    detachInterrupt(0);
    attachInterrupt(0, Isr_SensorFalling, FALLING);
    start = mmTaktCount;    
    frontDetected = true;
}

void Isr_SensorFalling()
{
    detachInterrupt(0);
    attachInterrupt(0, Isr_SensorRising, RISING);
    length = mmTaktCount - start    
    endDetected = true;
}

void Isr_mmTaktPulse()
{
    mmTaktCount ++;
}

You don't need detach/attach. All you need to do is change the value in the external interrupt control register EICRA, which has four bits controlling whether interrupt 0/1 is triggered on low, change, rising or falling. You can do that within the ISR.

e.g.

EICRA = 1; //any logical change on INT0 triggers interrupt.

See the ATmega328 data sheet, section 12.2.1

Why not use CHANGE? In the ISR, you can determine the current state of the interrupt pin, to know whether it was a RISING edge (now HIGH) or a FALLING edge (now LOW) that triggered the interrupt service routine.